ONE - On-device Neural Engine
|
#include <Shape.h>
Public Member Functions | |
Shape & | operator= (Shape const &)=delete |
Shape () | |
Shape (int dimensions_count) | |
Shape (int shape_size, int32_t value) | |
Shape (int dimensions_count, const int32_t *dims_data) | |
Shape (const std::initializer_list< int > init_list) | |
Shape (Shape const &other) | |
bool | operator== (const Shape &comp) const |
~Shape () | |
int32_t | DimensionsCount () const |
int32_t | Dims (int i) const |
void | SetDim (int i, int32_t val) |
int32_t * | DimsData () |
const int32_t * | DimsData () const |
const int32_t * | DimsDataUpTo4D () const |
void | Resize (int dimensions_count) |
void | ReplaceWith (int dimensions_count, const int32_t *dims_data) |
void | ReplaceWith (const Shape &other) |
void | ReplaceWith (Shape &&other) |
template<typename T > | |
void | BuildFrom (const T &src_iterable) |
void | BuildFrom (const std::initializer_list< int > init_list) |
int | FlatSize () const |
bool | operator!= (const Shape &comp) const |
Static Public Member Functions | |
static Shape | ExtendedShape (int new_shape_size, const Shape &shape) |
Static Public Attributes | |
static constexpr int | kMaxSmallSize = 5 |
|
inline |
|
inlineexplicit |
Definition at line 42 of file Shape.h.
References _dims_pointer, and kMaxSmallSize.
|
inline |
|
inline |
Definition at line 59 of file Shape.h.
References ReplaceWith().
|
inline |
Definition at line 64 of file Shape.h.
References BuildFrom().
|
inline |
Definition at line 68 of file Shape.h.
References _dims_pointer, DimsData(), and kMaxSmallSize.
|
inline |
Definition at line 83 of file Shape.h.
References _dims_pointer, and kMaxSmallSize.
|
inline |
|
inline |
Definition at line 152 of file Shape.h.
References DimsData(), and Resize().
Referenced by Shape().
|
inline |
Definition at line 91 of file Shape.h.
Referenced by nnfw::cker::train::Adam(), nnfw::cker::ArgMinMax(), nnfw::cker::AveragePool16(), nnfw::cker::train::AveragePool2DGrad(), nnfw::cker::AveragePool32(), nnfw::cker::AveragePool< float >(), nnfw::cker::AveragePool< int8_t >(), nnfw::cker::BatchToSpaceND(), nnfw::cker::bias_op::biasHelper(), nnfw::cker::functor::biasReductionHelper(), nnfw::cker::BroadcastComparison4DSlowImpl(), nnfw::cker::BroadcastComparison4DSlowWithScaling(), nnfw::cker::BroadcastSelect4DSlow(), nnfw::cker::BroadcastTo(), nnfw::cker::train::CategoricalCrossEntropyWithLogits(), nnfw::cker::checkMatching(), nnfw::cker::reference::Conv(), nnfw::cker::multithreaded::Conv(), nnfw::cker::reference::Conv(), nnfw::cker::reference::Conv(), nnfw::cker::optimized::Conv(), nnfw::cker::Tensor::copyFrom(), nnfw::cker::train::Depad(), nnfw::cker::DepthToSpace(), nnfw::cker::DepthwiseConv(), nnfw::cker::reference_integer_ops::DepthwiseConvHybridPerChannel(), nnfw::cker::optimized::DepthwiseConvImpl(), nnfw::cker::optimized_integer_ops::DepthwiseConvPerChannel(), nnfw::cker::reference_integer_ops::DepthwiseConvPerChannel(), nnfw::cker::optimized_integer_ops::DepthwiseConvWithRounding(), nnfw::cker::optimized::DepthwiseConvWithRounding(), nnfw::cker::optimized::DilatedIm2col(), nnfw::cker::optimized::ExtractPatchIntoBufferColumn(), nnfw::cker::FlatSizeSkipDim(), nnfw::cker::FloorDivBroadcast(), nnfw::cker::FloorModBroadcast(), nnfw::cker::BCast::FromShape(), nnfw::cker::FullyConnected(), nnfw::cker::train::FullyConnectedBiasGrad(), nnfw::cker::FullyConnectedSparseWeight16x1(), nnfw::cker::FullyConnectedSparseWeightRandom(), nnfw::cker::Gather(), nnfw::cker::train::GradientDescent(), nnfw::cker::reference::HybridConvPerChannel(), nnfw::cker::optimized::Im2col(), nnfw::cker::InitTensorDataForReduce(), nnfw::cker::L2NormalizeFloat32(), nnfw::cker::L2NormalizeQuant8(), nnfw::cker::LogicalAndBroadcast(), nnfw::cker::LogicalOrBroadcast(), nnfw::cker::LogSoftmax(), nnfw::cker::LogSoftmax(), nnfw::cker::MapAsMatrixWithLastDimAsRows(), nnfw::cker::MatchingFlatSizeSkipDim(), nnfw::cker::MatchingFlatSizeSkipDim(), nnfw::cker::MatMulBCast::MatMulBCast(), nnfw::cker::MatrixBandPart(), nnfw::cker::MaximumMinimumBroadcast4DSlow(), nnfw::cker::train::MaxPool2D(), nnfw::cker::train::MaxPool2DGrad(), nnfw::cker::MaxPool< float >(), nnfw::cker::MaxPool< uint8_t >(), nnfw::cker::Mean(), nnfw::cker::MeanAxis1And2(), nnfw::cker::MeanQ8Asymm(), nnfw::cker::Offset(), nnfw::cker::OneHot(), nnfw::cker::Einsum::operator()(), nnfw::cker::Pad(), nnfw::cker::FCTempArena::prepare(), nnfw::cker::BatchMatMul::prepare(), nnfw::cker::ReduceMean::PrepareforReduce(), nnfw::cker::ProcessBroadcastShapes(), nnfw::cker::Reduce::QuantizedMeanOrSum(), nnfw::cker::Reduce::ReduceGeneric(), nnfw::cker::ReduceImpl(), nnfw::cker::ReduceMeanImpl(), nnfw::cker::ReduceSumQuantImpl(), ReplaceWith(), nnfw::cker::ResizeBilinear(), nnfw::cker::Reverse(), nnfw::cker::RmsNorm(), nnfw::cker::reference::Softmax(), nnfw::cker::Softmax(), nnfw::cker::train::SoftMaxGrad(), nnfw::cker::SpaceToBatchND(), nnfw::cker::SpaceToDepth(), nnfw::cker::Split(), nnfw::cker::SplitV(), nnfw::cker::SqDiff(), nnfw::cker::StatelessRandomUniform(), nnfw::cker::StridedSlice(), nnfw::cker::TileOneDimension(), nnfw::cker::Transpose(), nnfw::cker::Transpose2D(), nnfw::cker::TransposeConv(), nnfw::cker::TransposeImpl(), nnfw::cker::reference::TransposeImpl(), and nnfw::cker::Unpack().
|
inline |
Definition at line 92 of file Shape.h.
References _dims, _dims_pointer, and kMaxSmallSize.
Referenced by nnfw::cker::ArgMinMax(), nnfw::cker::AveragePool16(), nnfw::cker::train::AveragePool2DGrad(), nnfw::cker::AveragePool32(), nnfw::cker::AveragePool< float >(), nnfw::cker::AveragePool< int8_t >(), nnfw::cker::train::backpropFilter(), nnfw::cker::train::backpropInput(), nnfw::cker::BatchMatMulParams::BatchMatMulParams(), nnfw::cker::BatchToSpaceND(), nnfw::cker::bias_op::biasHelper(), nnfw::cker::functor::biasReductionHelper(), nnfw::cker::reference::BroadcastBinaryArithmeticOpSlow(), nnfw::cker::reference::BroadcastBinaryArithmeticOpSlow(), nnfw::cker::reference::BroadcastBinaryArithmeticOpSlow(), nnfw::cker::reference::BroadcastBinaryArithmeticOpSlow(), nnfw::cker::reference::BroadcastBinaryArithmeticOpSlow(), nnfw::cker::BroadcastSelect4DSlow(), nnfw::cker::train::CategoricalCrossEntropy(), nnfw::cker::train::CategoricalCrossEntropyGrad(), nnfw::cker::train::CategoricalCrossEntropyWithLogits(), nnfw::cker::checkMatching(), nnfw::cker::Concatenation(), nnfw::cker::ConcatenationWithScaling(), nnfw::cker::reference::Conv(), nnfw::cker::multithreaded::Conv(), nnfw::cker::reference::Conv(), nnfw::cker::reference::Conv(), nnfw::cker::optimized::Conv(), nnfw::cker::train::ConvFilterGrad(), nnfw::cker::train::ConvInputGrad(), nnfw::cker::CopyDimsToDesc(), nnfw::cker::train::Depad(), nnfw::cker::DepthToSpace(), nnfw::cker::optimized_integer_ops::depthwise_conv::DepthwiseConvGeneral(), nnfw::cker::optimized::depthwise_conv::DepthwiseConvGeneral(), nnfw::cker::reference_integer_ops::DepthwiseConvHybridPerChannel(), nnfw::cker::optimized::DepthwiseConvImpl(), nnfw::cker::DepthwiseConvOp(), nnfw::cker::reference_integer_ops::DepthwiseConvPerChannel(), nnfw::cker::optimized_integer_ops::DepthwiseConvWithRounding(), nnfw::cker::optimized::DepthwiseConvWithRounding(), nnfw::cker::optimized::DilatedIm2col(), nnfw::cker::BCast::FromShape(), nnfw::cker::FullyConnected(), nnfw::cker::FullyConnected(), nnfw::cker::train::FullyConnectedBiasGrad(), nnfw::cker::FullyConnectedHybrid(), nnfw::cker::FullyConnectedSparseWeight16x1(), nnfw::cker::FullyConnectedSparseWeightRandom(), nnfw::cker::Gather(), nnfw::cker::HowManyConvThreads(), nnfw::cker::optimized_integer_ops::HowManyConvThreads(), nnfw::cker::reference::HybridConvPerChannel(), nnfw::cker::optimized::Im2col(), nnfw::cker::LogSoftmax(), nnfw::cker::LogSoftmax(), nnfw::cker::MapAsMatrixWithLastDimAsRows(), nnfw::cker::MatchingDim(), nnfw::cker::MatchingDim(), nnfw::cker::MatchingFlatSizeSkipDim(), nnfw::cker::MatchingFlatSizeSkipDim(), nnfw::cker::MatMulBCast::MatMulBCast(), nnfw::cker::MatrixBandPart(), nnfw::cker::train::MaxPool2D(), nnfw::cker::MaxPool< float >(), nnfw::cker::MaxPool< uint8_t >(), nnfw::cker::MeanAxis1And2(), nnfw::cker::train::MSE(), nnfw::cker::train::MSEGrad(), nnfw::cker::OneHot(), nnfw::cker::Einsum::operator()(), nnfw::cker::ShapeIterator::operator*(), nnfw::cker::Pad(), onert::backend::cpu::ops::ConvolutionLayer::prepare(), onert::backend::cpu::ops::FullyConnectedLayer::prepare(), nnfw::cker::FCTempArena::prepare(), nnfw::cker::BatchMatMul::prepare(), nnfw::cker::ProcessBroadcastShapes(), nnfw::cker::Reduce::QuantizedMeanOrSum(), nnfw::cker::ResizeBilinear(), nnfw::cker::ResizeBilinear(), nnfw::cker::ResizeBilinear(), nnfw::cker::ResizeBilinearKernel2x2(), nnfw::cker::Reverse(), nnfw::cker::RmsNorm(), nnfw::cker::RoPE(), nnfw::cker::Tensor::shaped(), nnfw::cker::Slice(), nnfw::cker::train::SoftMaxGrad(), nnfw::cker::SpaceToBatchND(), nnfw::cker::SpaceToDepth(), nnfw::cker::Split(), nnfw::cker::SplitV(), nnfw::cker::StartForAxis(), nnfw::cker::StopForAxis(), nnfw::cker::StridedSlice(), nnfw::cker::TileOneDimension(), nnfw::cker::Transpose3D(), nnfw::cker::TransposeConv(), and nnfw::cker::Unpack().
|
inline |
Definition at line 112 of file Shape.h.
References _dims, _dims_pointer, and kMaxSmallSize.
Referenced by nnfw::cker::train::Adam(), nnfw::cker::BroadcastTo(), BuildFrom(), nnfw::cker::train::CategoricalCrossEntropyWithLogits(), nnfw::cker::Tensor::copyFrom(), FlatSize(), nnfw::cker::FlatSizeSkipDim(), onert::backend::cpu::ops::getShape(), onert::backend::train::ops::getShape(), nnfw::cker::train::GradientDescent(), nnfw::cker::InitTensorDataForReduce(), nnfw::cker::Einsum::operator()(), operator==(), nnfw::cker::ReduceMean::PrepareforReduce(), nnfw::cker::ReduceImpl(), nnfw::cker::ReduceMeanImpl(), nnfw::cker::ReduceSumQuantImpl(), ReplaceWith(), ReplaceWith(), Shape(), nnfw::cker::StatelessRandomUniform(), and nnfw::cker::Transpose2D().
|
inline |
|
inline |
|
inlinestatic |
|
inline |
Definition at line 181 of file Shape.h.
References DimsData().
Referenced by nnfw::cker::optimized::AddBiasAndEvalActivationFunction(), nnfw::cker::AddN(), nnfw::cker::train::AveragePool2DGrad(), nnfw::cker::BroadcastTo(), nnfw::cker::checkMatching(), nnfw::cker::Tensor::copyFrom(), nnfw::cker::reference_integer_ops::DepthwiseConvHybridPerChannel(), nnfw::cker::optimized_integer_ops::DepthwiseConvWithRounding(), nnfw::cker::optimized::DepthwiseConvWithRounding(), nnfw::cker::Tensor::flat(), nnfw::cker::Tensor::flat(), nnfw::cker::FloorDivElementwise(), nnfw::cker::FloorModElementwise(), nnfw::cker::FullyConnected(), nnfw::cker::train::FullyConnectedBiasGrad(), onert::backend::cpu::ops::FullyConnectedLayer::fullyConnectedHybrid(), nnfw::cker::FullyConnectedHybrid(), nnfw::cker::Gather(), nnfw::cker::LogicalAndElementwise(), nnfw::cker::LogicalOrElementwise(), nnfw::cker::MapAsVector(), nnfw::cker::MatchingElementsSize(), nnfw::cker::MatchingFlatSize(), nnfw::cker::MatMulBCast::MatMulBCast(), nnfw::cker::train::MaxPool2DGrad(), nnfw::cker::OneHot(), nnfw::cker::Conv::operator()(), onert::backend::cpu::ops::FullyConnectedLayer::prepare(), nnfw::cker::FCTempArena::prepare(), nnfw::cker::BatchMatMul::prepare(), nnfw::cker::RankOneSelect(), nnfw::cker::functor::BroadcastTo< Device, T >::ReshapeAndBCast(), and nnfw::cker::Transpose().
|
inline |
|
inline |
Definition at line 77 of file Shape.h.
References DimsData().
|
inline |
Definition at line 137 of file Shape.h.
References DimensionsCount(), DimsData(), and ReplaceWith().
|
inline |
Definition at line 130 of file Shape.h.
References DimsData(), and Resize().
Referenced by nnfw::cker::train::Adam(), onert::backend::train::ops::MeanLayer::backward(), nnfw::cker::BroadcastTo(), nnfw::cker::train::CategoricalCrossEntropyWithLogits(), nnfw::cker::FusedBatchNorm::copyFrom(), nnfw::cker::Tensor::copyFrom(), nnfw::cker::train::GradientDescent(), nnfw::cker::MatMulBCast::MatMulBCast(), nnfw::cker::Einsum::operator()(), ReplaceWith(), Shape(), and nnfw::cker::StatelessRandomUniform().
|
inline |
Definition at line 142 of file Shape.h.
References _dims, _dims_pointer, kMaxSmallSize, and Resize().
|
inline |
Definition at line 117 of file Shape.h.
References _dims_pointer, and kMaxSmallSize.
Referenced by BuildFrom(), nnfw::cker::BatchMatMul::prepare(), ReplaceWith(), ReplaceWith(), and Shape().
|
inline |
Definition at line 98 of file Shape.h.
References _dims, _dims_pointer, and kMaxSmallSize.
Referenced by onert::backend::train::ops::MeanLayer::backward(), nnfw::cker::BatchToSpaceND(), nnfw::cker::BatchMatMul::prepare(), Shape(), and nnfw::cker::BCast::ToShape().
int32_t nnfw::cker::Shape::_dims[kMaxSmallSize] |
Definition at line 215 of file Shape.h.
Referenced by Dims(), DimsData(), DimsData(), DimsDataUpTo4D(), ReplaceWith(), and SetDim().
int32_t* nnfw::cker::Shape::_dims_pointer {nullptr} |
Definition at line 216 of file Shape.h.
Referenced by Dims(), DimsData(), DimsData(), ReplaceWith(), Resize(), SetDim(), Shape(), Shape(), and ~Shape().
|
staticconstexpr |
Definition at line 36 of file Shape.h.
Referenced by Dims(), DimsData(), DimsData(), ReplaceWith(), Resize(), SetDim(), Shape(), Shape(), and ~Shape().