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

Method GetNumElements

src/armnn/Tensor.cpp:181–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181unsigned int TensorShape::GetNumElements() const
182{
183 CheckUnspecifiedNumDimensions();
184
185 if (m_NumDimensions == 0)
186 {
187 return 0;
188 }
189
190 unsigned int count = 1;
191 bool atLeastOneDimensionSpecified = false;
192 for (unsigned int i = 0; i < m_NumDimensions; ++i)
193 {
194 if (m_DimensionsSpecificity[i])
195 {
196 atLeastOneDimensionSpecified = true;
197 count *= m_Dimensions[i];
198 }
199 }
200
201 if (atLeastOneDimensionSpecified)
202 {
203 return count;
204 }
205 else
206 {
207 return 0;
208 }
209}
210
211bool TensorShape:: GetDimensionSpecificity(unsigned int i) const
212{

Callers 15

mainFunction · 0.45
ArmnnNetworkExecutorMethod · 0.45
VisitScatterNdOperatorFunction · 0.45
VisitPadOperatorFunction · 0.45
VisitReshapeOperatorFunction · 0.45
VisitMeanOperatorFunction · 0.45
VisitReduceOperatorFunction · 0.45
VisitTileOperatorFunction · 0.45
VisitSplitOperatorFunction · 0.45

Calls

no outgoing calls

Tested by 15

RunTestMethod · 0.36
CompareConstTensorFunction · 0.36
QuantizeDataFunction · 0.36
MockPerAxisIteratorMethod · 0.36
QuantizeDataFunction · 0.36
SpaceToBatchNdEndToEndFunction · 0.36
BatchToSpaceNdEndToEndFunction · 0.36
DetectionPostProcessImplFunction · 0.36
QuantizeDataFunction · 0.36