23 if (!static_cast<PermuteLayer&>(base).GetParameters().m_DimMappings.IsEqual(
PermutationVector{ 3, 1, 2, 0 }))
40 if (batchToSpaceDesc.
m_Crops != std::vector<std::pair<unsigned int, unsigned int>>{ { 0, 0 }, { 0, 0 } })
45 if (batchToSpaceDesc.m_BlockShape.size() != 2 ||
46 batchToSpaceDesc.m_BlockShape[0] != batchToSpaceDesc.m_BlockShape[1])
51 uint32_t blockSize = batchToSpaceDesc.m_BlockShape[0];
52 if (outputInfo.GetShape()[0] != 1 || outputInfo.GetShape()[3] != 1)
64 bool isIntermediateQuantParamsSameAsInput =
65 intermediateInfo.GetQuantizationScale() == inputInfo.GetQuantizationScale() &&
66 intermediateInfo.GetQuantizationOffset() == inputInfo.GetQuantizationOffset();
67 bool isIntermediateQuantParamsSameAsOutput =
68 intermediateInfo.GetQuantizationScale() == outputInfo.GetQuantizationScale() &&
69 intermediateInfo.GetQuantizationOffset() == outputInfo.GetQuantizationOffset();
70 if (!isIntermediateQuantParamsSameAsInput && !isIntermediateQuantParamsSameAsOutput)
76 const std::string name = std::string(
"merged-") + base.
GetName() + std::string(
"-with-") + child.GetName();
80 auto& depthToSpace = *graph.InsertNewLayer<
DepthToSpaceLayer>(base.GetInputSlot(0), depthToSpaceDesc, name.c_str());
86 child.GetOutputSlot().MoveAllConnections(depthToSpace.GetOutputSlot());
const OutputHandler & GetOutputHandler(unsigned int i=0) const
This layer represents a DepthToSpace operation.
This layer represents a BatchToSpaceNd operation.
LayerType GetType() const
const char * GetName() const override
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
virtual const TensorInfo & GetTensorInfo() const =0
unsigned int GetNumDimensions() const
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
void Run(Graph &graph, InputSlot &connection) const
void SetTensorInfo(const TensorInfo &tensorInfo)
Sets the TensorInfo used by this output handler.
std::vector< std::pair< unsigned int, unsigned int > > m_Crops
The values to crop from the input dimension.
const TensorInfo & GetTensorInfo() const override
Layer & GetOwningLayer() const
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
const InputSlot & GetInputSlot(unsigned int index) const override