MCPcopy Create free account
hub / github.com/ARM-software/armnn / ValidateTensorShapesFromInputs

Method ValidateTensorShapesFromInputs

src/armnn/layers/SplitterLayer.cpp:205–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void SplitterLayer::ValidateTensorShapesFromInputs()
206{
207 std::for_each(BeginOutputSlots(), EndOutputSlots(), [&](OutputSlot& outputSlot)
208 {
209 VerifyShapeInferenceType(outputSlot.GetTensorInfo().GetShape(), m_ShapeInferenceMethod);
210 });
211
212 std::vector<TensorShape> views;
213 for (unsigned int viewIdx = 0; viewIdx < m_Param.GetNumViews(); viewIdx++)
214 {
215 const uint32_t* sizes = m_Param.GetViewSizes(viewIdx);
216 views.push_back(TensorShape(m_Param.GetNumDimensions(), sizes));
217 }
218
219 auto inferredShapes = InferOutputShapes(views);
220
221 if (inferredShapes.size() != m_Param.GetNumViews())
222 {
223 throw armnn::LayerValidationException("inferredShapes' size and m_NumViews do not match (\""
224 + std::to_string(inferredShapes.size()) +
225 "\" vs \""
226 + std::to_string(m_Param.GetNumViews()) + "\")");
227 }
228
229 for (unsigned int viewIdx = 0; viewIdx < m_Param.GetNumViews(); viewIdx++)
230 {
231 ValidateAndCopyShape(GetOutputSlot(viewIdx).GetTensorInfo().GetShape(),
232 inferredShapes[viewIdx],
233 m_ShapeInferenceMethod,
234 "SplitterLayer",
235 viewIdx);
236 }
237}
238
239void SplitterLayer::ExecuteStrategy(IStrategy& strategy) const
240{

Callers

nothing calls this directly

Calls 9

GetNumViewsMethod · 0.80
GetViewSizesMethod · 0.80
push_backMethod · 0.80
TensorShapeClass · 0.50
to_stringFunction · 0.50
GetShapeMethod · 0.45
GetNumDimensionsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected