Skip to content
Snippets Groups Projects
Commit 2a2ccd7c authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed merge issues

parent 9f2086c7
No related branches found
No related tags found
2 merge requests!93Release v0.3.0,!72Im2col
Pipeline #50197 passed
...@@ -27,8 +27,13 @@ namespace Aidge { ...@@ -27,8 +27,13 @@ namespace Aidge {
class FoldImpl2DForward_cpu class FoldImpl2DForward_cpu
: public Registrable<FoldImpl2DForward_cpu, : public Registrable<FoldImpl2DForward_cpu,
std::tuple<DataType, DataType>, std::tuple<DataType, DataType>,
void(const Fold_Op<2>::Attrs &, const std::vector<DimSize_t> &, const void *, void(const std::array<DimSize_t, 2>&,
void *)> {}; const std::array<DimSize_t, 2>&,
const std::array<DimSize_t, 2>&,
const std::array<DimSize_t, 2>&,
const std::vector<DimSize_t> &,
const void *,
void *)> {};
class FoldImpl2D_cpu : public OperatorImpl { class FoldImpl2D_cpu : public OperatorImpl {
public: public:
......
...@@ -23,17 +23,18 @@ ...@@ -23,17 +23,18 @@
namespace Aidge { namespace Aidge {
template <class I, class O> template <class I, class O>
void FoldImpl2D_cpu_forward_kernel(const Fold_Op<2>::Attrs &attrs, const std::vector<DimSize_t> &dims, void FoldImpl2D_cpu_forward_kernel(const std::array<DimSize_t, 2>& outputDims,
const void *input_, void *output_) const std::array<DimSize_t, 2>& strideDims,
const std::array<DimSize_t, 2>& dilationDims,
const std::array<DimSize_t, 2>& kernelDims,
const std::vector<DimSize_t> &dims,
const void *input_, void *output_)
{ {
const I *input = static_cast<const I *>(input_); const I *input = static_cast<const I *>(input_);
O *output = static_cast<O *>(output_); O *output = static_cast<O *>(output_);
const auto kernelDims = std::get<3>(attrs); const DimSize_t inHeight = outputDims[0];
const auto dilationDims = std::get<2>(attrs); const DimSize_t inWidth = outputDims[1];
const auto strideDims = std::get<1>(attrs);
const DimSize_t inHeight = std::get<0>(attrs)[0];
const DimSize_t inWidth = std::get<0>(attrs)[1];
const DimSize_t kernelExtentHeight = dilationDims[0] * const DimSize_t kernelExtentHeight = dilationDims[0] *
(kernelDims[0] - 1) + 1; (kernelDims[0] - 1) + 1;
......
...@@ -30,8 +30,12 @@ void Aidge::FoldImpl2D_cpu::forward() { ...@@ -30,8 +30,12 @@ void Aidge::FoldImpl2D_cpu::forward() {
Registrar<FoldImpl2DForward_cpu>::create({std::static_pointer_cast<Tensor>(mOp.getRawInput(0))->dataType(), std::static_pointer_cast<Tensor>(mOp.getRawOutput(0))->dataType()}); Registrar<FoldImpl2DForward_cpu>::create({std::static_pointer_cast<Tensor>(mOp.getRawInput(0))->dataType(), std::static_pointer_cast<Tensor>(mOp.getRawOutput(0))->dataType()});
// Call kernel // Call kernel
kernelFunc(dynamic_cast<const Fold_Op<2>&>(mOp).getStaticAttributes(), const auto& op_ = static_cast<const Fold_Op<2>&>(mOp);
std::static_pointer_cast<Tensor>(mOp.getRawInput(0))->dims(), kernelFunc(op_.outputDims(),
getCPUPtr(mOp.getRawInput(0)), op_.strideDims(),
getCPUPtr(mOp.getRawOutput(0))); op_.dilationDims(),
op_.kernelDims(),
std::static_pointer_cast<Tensor>(mOp.getRawInput(0))->dims(),
getCPUPtr(mOp.getRawInput(0)),
getCPUPtr(mOp.getRawOutput(0)));
} }
...@@ -67,7 +67,7 @@ TEST_CASE("[ConvToMatMul] conv") { ...@@ -67,7 +67,7 @@ TEST_CASE("[ConvToMatMul] conv") {
// Simplify the graph: freeze parameters to allow reshaping of the Producers // Simplify the graph: freeze parameters to allow reshaping of the Producers
for (auto node : g2->getNodes()) { for (auto node : g2->getNodes()) {
if (node->type() == Producer_Op::Type && node->name() != "dataProvider") { if (node->type() == Producer_Op::Type && node->name() != "dataProvider") {
std::static_pointer_cast<Producer_Op>(node->getOperator())->getAttr<bool>("Constant") = true; std::static_pointer_cast<Producer_Op>(node->getOperator())->constant() = true;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment