Skip to content
Snippets Groups Projects

[Add] DepthToSpace Operator

Merged Maxence Naud requested to merge feat_140_add-operator-depthToSpace into dev
1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
@@ -26,8 +26,6 @@ void Aidge::DepthToSpace_OpImpl::forward() {
// Get input dimensions
const auto& dims = op.getInput(0)->dims<4>();
// Assert that c is divisible by blocksize squared
assert(dims[1] % (op.blockSize() * op.blockSize()) == 0 && "Number of channels must be divisible by blocksize squared");
// get final output dimension
const std::array<DimSize_t, 4> final_dims = op.getOutput(0)->dims<4>();
@@ -63,6 +61,7 @@ const std::string Aidge::DepthToSpace_Op::Type = "DepthToSpace";
bool Aidge::DepthToSpace_Op::forwardDims(bool /*allowDataDependency*/) {
if (inputsAssociated()) {
AIDGE_ASSERT(getInput(0)->nbDims() == 4, "{} Operator only accepts 4-D input Tensors.", DepthToSpace_Op::Type);
AIDGE_ASSERT(getInput(0)->dims()[1] % (blockSize() * blockSize()) == 0, "Number of channels must be divisible by blocksize squared");
// Compute output dims
const std::array<DimSize_t, 4>& inDims = getInput(0)->dims<4>();
Loading