11 namespace optimizations
17 template <
typename PermuteType>
33 if (!
static_cast<PermuteType&
>(base).GetParameters().m_DimMappings.IsEqual(
PermutationVector{ 3, 1, 2, 0 }))
50 if (batchToSpaceDesc.
m_Crops != std::vector<std::pair<unsigned int, unsigned int>>{ { 0, 0 }, { 0, 0 } })
55 if (batchToSpaceDesc.m_BlockShape.size() != 2 ||
56 batchToSpaceDesc.m_BlockShape[0] != batchToSpaceDesc.m_BlockShape[1])
61 uint32_t blockSize = batchToSpaceDesc.m_BlockShape[0];
62 if (outputInfo.GetShape()[0] != 1 || outputInfo.GetShape()[3] != 1)
74 bool isIntermediateQuantParamsSameAsInput =
75 intermediateInfo.GetQuantizationScale() == inputInfo.GetQuantizationScale() &&
76 intermediateInfo.GetQuantizationOffset() == inputInfo.GetQuantizationOffset();
77 bool isIntermediateQuantParamsSameAsOutput =
78 intermediateInfo.GetQuantizationScale() == outputInfo.GetQuantizationScale() &&
79 intermediateInfo.GetQuantizationOffset() == outputInfo.GetQuantizationOffset();
80 if (!isIntermediateQuantParamsSameAsInput && !isIntermediateQuantParamsSameAsOutput)
86 const std::string name = std::string(
"merged-") + base.
GetName() + std::string(
"-with-") + child.GetName();
90 auto& depthToSpace = *graph.InsertNewLayer<DepthToSpaceLayer>(base.GetInputSlot(0),
97 child.GetOutputSlot().MoveAllConnections(depthToSpace.GetOutputSlot());