/packages/modules/NeuralNetworks/common/operations/ |
D | L2Normalization.cpp | 48 inline bool l2normFloat32Impl(const float* inputData, const Shape& inputShape, int32_t axis, in l2normFloat32Impl() argument 52 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in l2normFloat32Impl() 53 const uint32_t axisSize = getSizeOfDimension(inputShape, axis); in l2normFloat32Impl() 55 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in l2normFloat32Impl() 76 inline bool l2normQuant8Impl(const uint8_t* inputData, const Shape& inputShape, int32_t axis, in l2normQuant8Impl() argument 79 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in l2normQuant8Impl() 80 const uint32_t axisSize = getSizeOfDimension(inputShape, axis); in l2normQuant8Impl() 82 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in l2normQuant8Impl() 108 inline bool l2normQuant8SignedImpl(const int8_t* inputData, const Shape& inputShape, int32_t axis, in l2normQuant8SignedImpl() argument 111 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in l2normQuant8SignedImpl() [all …]
|
D | Split.cpp | 29 bool splitGeneric(const Scalar* inputData, const Shape& inputShape, int32_t axis, in splitGeneric() argument 32 NN_CHECK(handleNegativeAxis(inputShape, &axis)); in splitGeneric() 34 for (int i = 0; i < axis; ++i) { in splitGeneric() 39 for (int i = axis + 1; i < concatDimensions; ++i) { in splitGeneric() 46 const int copySize = outputShapes[i].dimensions[axis] * baseInnerSize; in splitGeneric() 55 bool splitFloat16(const _Float16* inputData, const Shape& inputShape, int32_t axis, in splitFloat16() argument 59 return splitGeneric<_Float16>(inputData, inputShape, axis, outputDataPtrs, outputShapes); in splitFloat16() 62 bool splitFloat32(const float* inputData, const Shape& inputShape, int32_t axis, in splitFloat32() argument 66 return splitGeneric<float>(inputData, inputShape, axis, outputDataPtrs, outputShapes); in splitFloat32() 69 bool splitQuant8(const uint8_t* inputData, const Shape& inputShape, int32_t axis, in splitQuant8() argument [all …]
|
D | LocalResponseNormalization.cpp | 53 int32_t axis, float* outputData, in localResponseNormFloat32Impl() argument 56 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in localResponseNormFloat32Impl() 57 const uint32_t axisSize = getSizeOfDimension(inputShape, axis); in localResponseNormFloat32Impl() 59 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in localResponseNormFloat32Impl() 83 T beta, int32_t axis, T* outputData, const Shape& outputShape); 87 float bias, float alpha, float beta, int32_t axis, float* outputData, in localResponseNorm() argument 90 NN_CHECK(handleNegativeAxis(inputShape, &axis)); in localResponseNorm() 91 radius = std::min(radius, static_cast<int32_t>(inputShape.dimensions[axis])); in localResponseNorm() 93 if (axis == ndim - 1) { in localResponseNorm() 102 return localResponseNormFloat32Impl(inputData, inputShape, radius, bias, alpha, beta, axis, in localResponseNorm() [all …]
|
D | Softmax.cpp | 54 int32_t axis, float* outputData, const Shape& outputShape) { in softmaxSlowFloat32() argument 56 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in softmaxSlowFloat32() 57 const uint32_t axisSize = getSizeOfDimension(inputShape, axis); in softmaxSlowFloat32() 59 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in softmaxSlowFloat32() 85 bool softmaxFloat32(const float* inputData, const Shape& inputShape, const float beta, int32_t axis, in softmaxFloat32() argument 88 NN_CHECK(handleNegativeAxis(inputShape, &axis)); in softmaxFloat32() 90 if (axis == ndim - 1) { in softmaxFloat32() 97 return softmaxSlowFloat32(inputData, inputShape, beta, axis, outputData, outputShape); in softmaxFloat32() 102 int32_t axis, _Float16* outputData, const Shape& outputShape) { in softmaxFloat16() argument 108 softmaxFloat32(inputData_float32.data(), inputShape, beta, axis, outputData_float32.data(), in softmaxFloat16() [all …]
|
D | Gather.cpp | 40 inline bool eval(const T* inputData, const Shape& inputShape, int32_t axis, in eval() argument 42 const auto outerSize = getNumberOfElements(inputShape, 0, axis); in eval() 43 const auto axisSize = getSizeOfDimension(inputShape, axis); in eval() 45 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in eval() 84 int32_t axis = context->getInputValue<int32_t>(kInputAxis); in prepare() local 85 NN_RET_CHECK(handleNegativeAxis(input, &axis)); in prepare() 92 input.dimensions.begin() + axis); in prepare() 95 output.dimensions.insert(output.dimensions.end(), input.dimensions.begin() + axis + 1, in prepare() 102 int32_t axis = context->getInputValue<int32_t>(kInputAxis); in execute() local 103 NN_RET_CHECK(handleNegativeAxis(context->getInputShape(kInputTensor), &axis)); in execute() [all …]
|
D | ChannelShuffle.cpp | 38 inline bool eval(const T* inputData, const Shape& inputShape, int32_t numGroups, int32_t axis, in eval() argument 40 const uint32_t outerSize = getNumberOfElements(inputShape, 0, axis); in eval() 41 const uint32_t axisSize = getSizeOfDimension(inputShape, axis); in eval() 43 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in eval() 85 int32_t axis = context->getInputValue<int32_t>(kInputAxis); in prepare() local 86 NN_RET_CHECK(handleNegativeAxis(input, &axis)); in prepare() 88 NN_RET_CHECK(getSizeOfDimension(input, axis) % numGroups == 0); in prepare() 94 int32_t axis = context->getInputValue<int32_t>(kInputAxis); in execute() local 95 NN_RET_CHECK(handleNegativeAxis(context->getInputShape(kInputTensor), &axis)); in execute() 99 context->getInputShape(kInputTensor), numGroups, axis, in execute() [all …]
|
D | ArgMinMax.cpp | 29 static void argMinMaxImpl(const In* inputData, const Shape& inputShape, int32_t axis, bool isArgMin, in argMinMaxImpl() argument 31 const int outerSize = getNumberOfElements(inputShape, 0, axis); in argMinMaxImpl() 32 const int axisSize = getSizeOfDimension(inputShape, axis); in argMinMaxImpl() 34 getNumberOfElements(inputShape, axis + 1, getNumberOfDimensions(inputShape)); in argMinMaxImpl() 51 bool argMinMaxGeneric(const uint8_t* inputData, const Shape& inputShape, int32 axis, bool isArgMin, in argMinMaxGeneric() argument 54 NN_CHECK(handleNegativeAxis(inputShape, &axis)); in argMinMaxGeneric() 59 argMinMaxImpl(reinterpret_cast<const dataType*>(inputData), inputShape, axis, isArgMin, \ in argMinMaxGeneric()
|
D | Concatenation.cpp | 51 const std::vector<Shape>& inputShapes, int32_t axis, T* outputData, in concatenation() argument 63 getNumberOfDimensions(outputShape) - axis - 1, inputDataPtrs.data(), in concatenation() 71 const std::vector<Shape>& inputShapes, int32_t axis, in concatenation() argument 88 getNumberOfDimensions(outputShape) - axis - 1, inputDataPtrs.data(), in concatenation() 187 int32_t axis = context->getInputValue<int32_t>(numInputs - 1); in prepare() local 188 NN_RET_CHECK_GE(axis, 0); in prepare() 189 NN_RET_CHECK_LT(axis, numDimensions); in prepare() 192 uint32_t sumAxis = getSizeOfDimension(input0, axis); in prepare() 198 if (d == axis) { in prepare() 199 sumAxis += getSizeOfDimension(input, axis); in prepare() [all …]
|
D | SimpleMath.cpp | 33 bool meanFloat16(_Float16* inputData, const Shape& inputShape, const int32_t* axis, in meanFloat16() argument 41 meanGeneric<float, float>(inputDataFloat32.data(), inputShape, axis, axisShape, keepDims, in meanFloat16() 48 bool meanGeneric(T* inputData, const Shape& inputShape, const int32_t* axis, const Shape& axisShape, in meanGeneric() argument 69 getNumberOfDimensions(outputShape), axis, axisSize, keepDims, scratchBuffer, in meanGeneric() 78 const int32_t* axis, const Shape& axisShape, bool keepDims, 81 const int32_t* axis, const Shape& axisShape, 85 const int32_t* axis, const Shape& axisShape,
|
D | LogSoftmax.cpp | 42 inline bool compute(const T* input, const Shape& shape, T beta, uint32_t axis, T* output) { in compute() argument 43 const uint32_t outerSize = getNumberOfElements(shape, 0, axis); in compute() 44 const uint32_t axisSize = getSizeOfDimension(shape, axis); in compute() 45 const uint32_t innerSize = getNumberOfElements(shape, axis + 1, getNumberOfDimensions(shape)); in compute() 98 int32_t axis = context->getInputValue<int32_t>(kInputAxis); in execute() local 99 NN_RET_CHECK(handleNegativeAxis(context->getInputShape(kInputTensor), &axis)); in execute() 104 context->getInputValue<_Float16>(kInputBeta), axis, in execute() 109 context->getInputValue<float>(kInputBeta), axis, in execute()
|
D | Reduce.cpp | 141 int32_t axis = axes[i]; in prepare() local 142 NN_RET_CHECK(handleNegativeAxis(inputRank, &axis)); in prepare() 143 shouldReduce[axis] = true; in prepare() 150 for (uint32_t axis = 0; axis < inputRank; ++axis) { in prepare() local 151 if (shouldReduce[axis]) { in prepare() 156 outputShape.dimensions.push_back(getSizeOfDimension(inputShape, axis)); in prepare()
|
/packages/modules/NeuralNetworks/runtime/test/specs/V1_3/ |
D | gather_quant8_signed.mod.py | 18 axis = 1 variable 22 model = Model().Operation("GATHER", input0, axis, indices).To(output0) 46 def test(input0, axis, indices, output0, input_data, output_data): argument 47 model = Model().Operation("GATHER", input0, axis, indices).To(output0) 61 axis=0, 72 axis=0, 82 axis=0, 91 axis=0, 100 axis=0, 113 axis=0, [all …]
|
D | split_quant8_signed.mod.py | 18 axis = Int32Scalar("axis", 0) variable 24 model = Model().Operation("SPLIT", input0, axis, num_splits).To( 41 axis = Int32Scalar("axis", 0) variable 46 model = Model().Operation("SPLIT", input0, axis, num_splits).To( 62 axis = Int32Scalar("axis", 1) variable 68 model = Model().Operation("SPLIT", input0, axis, num_splits).To( 85 axis = Int32Scalar("axis", 1) variable 92 model = Model().Operation("SPLIT", input0, axis, num_splits).To(
|
D | argmin_quant8_signed.mod.py | 19 axis = Int32Scalar("axis", -1) variable 22 model = Model().Operation("ARGMIN", input0, axis).To(output0) 37 axis = Int32Scalar("axis", 0) variable 40 model = Model().Operation("ARGMIN", input0, axis).To(output0) 55 axis = Int32Scalar("axis", 1) variable 58 model = Model().Operation("ARGMIN", input0, axis).To(output0)
|
D | argmax_quant8_signed.mod.py | 18 axis = Int32Scalar("axis", 1) variable 21 model = Model().Operation("ARGMAX", input0, axis).To(output0) 36 axis = Int32Scalar("axis", 0) variable 39 model = Model().Operation("ARGMAX", input0, axis).To(output0) 56 axis = Int32Scalar("axis", -1) variable 59 model = Model().Operation("ARGMAX", input0, axis).To(output0)
|
D | softmax_quant8_signed.mod.py | 60 axis = Int32Scalar("axis", -1) # last axis variable 93 Model("axis").Operation("SOFTMAX", i, 1.0, axis).To(o) 94 Example(example1).AddVariations(quant8_signed, includeDefault=False).AddAllDimsAndAxis(i, o, axis) 96 Model("axis").Operation("SOFTMAX", i, 0.000001, axis).To(o) 97 Example(example2).AddVariations(quant8_signed, includeDefault=False).AddAllDimsAndAxis(i, o, axis)
|
D | mean_quant8_signed.mod.py | 18 axis = Parameter("axis", "TENSOR_INT32", "{4}", [1, 0, -3, -3]) variable 22 model = model.Operation("MEAN", i1, axis, keepDims).To(output) 42 axis = Parameter("axis", "TENSOR_INT32", "{2}", [0, 2]) variable 46 model = model.Operation("MEAN", i1, axis, keepDims).To(output)
|
/packages/modules/NeuralNetworks/runtime/test/specs/V1_2/ |
D | gather.mod.py | 17 def test(input0, axis, indices, output0, input_data, output_data): argument 18 model = Model().Operation("GATHER", input0, axis, indices).To(output0) 42 axis=0, 53 axis=0, 63 axis=0, 72 axis=0, 81 axis=0, 94 axis=0, 103 axis=1, 114 axis=-1,
|
D | l2_normalization_axis.mod.py | 20 axis = Int32Scalar("axis", -1) # last axis variable 47 Model().Operation("L2_NORMALIZATION", i1, axis).To(o1) 48 Example(example0).AddAllDimsAndAxis(i1, o1, axis).AddVariations("relaxed", "float16", quant8) 54 axis = Int32Scalar("axis", -1) # last axis variable 56 Model("corner_case").Operation("L2_NORMALIZATION", i2, axis).To(o2) 60 }).AddAllDimsAndAxis(i2, o2, axis)
|
D | log_softmax.mod.py | 19 def test(input0, output0, input_data, beta, axis, output_data): argument 20 model = Model().Operation("LOG_SOFTMAX", input0, beta, axis).To(output0) 32 axis=4, 45 axis=-1, 58 axis=-3, 69 axis=4,
|
D | local_response_normalization_v1_2.mod.py | 19 axis = Int32Scalar("axis", -1) # last axis variable 23 Model("axis").Operation("LOCAL_RESPONSE_NORMALIZATION", i, 20, 9.0, 4.0, 0.5, axis).To(o) 26 })).AddAllDimsAndAxis(i, o, axis).AddVariations("relaxed", "float16") 29 Model("axis").Operation("LOCAL_RESPONSE_NORMALIZATION", i, 2, 9.0, 4.0, 0.5, axis).To(o) 32 })).AddAllDimsAndAxis(i, o, axis).AddVariations("relaxed", "float16")
|
D | softmax_v1_2.mod.py | 19 axis = Int32Scalar("axis", -1) # last axis variable 51 Model("axis").Operation("SOFTMAX", i, 1.0, axis).To(o) 52 Example(example1).AddVariations("relaxed", "float16", quant8).AddAllDimsAndAxis(i, o, axis) 54 Model("axis").Operation("SOFTMAX", i, 0.000001, axis).To(o) 55 Example(example2).AddVariations("relaxed", "float16", quant8).AddAllDimsAndAxis(i, o, axis)
|
/packages/modules/NeuralNetworks/common/include/ |
D | Operations.h | 84 float bias, float alpha, float beta, int32_t axis, 87 float bias, float alpha, float beta, int32_t axis, float* outputData, 113 bool meanFloat16(_Float16* inputData, const Shape& inputShape, const int32_t* axis, 117 bool meanGeneric(T* inputData, const Shape& inputShape, const int32_t* axis, const Shape& axisShape, 125 bool argMinMaxGeneric(const uint8_t* inputData, const Shape& inputShape, int32_t axis, 128 bool splitFloat16(const _Float16* inputData, const Shape& inputShape, int32_t axis, 132 bool splitFloat32(const float* inputData, const Shape& inputShape, const int32_t axis, 136 bool splitInt32(const int32_t* inputData, const Shape& inputShape, const int32_t axis, 140 bool splitQuant8(const uint8_t* inputData, const Shape& inputShape, const int32_t axis, 144 bool splitQuant8Signed(const int8_t* inputData, const Shape& inputShape, const int32_t axis, [all …]
|
/packages/modules/NeuralNetworks/runtime/test/fuzzing/operation_signatures/ |
D | ConcatSplit.cpp | 31 int32_t axis = getUniform<int32_t>(0, rank - 1); in concatConstructor() local 32 op->inputs[numInputs]->setScalarValue<int32_t>(axis); in concatConstructor() 37 if (axis == static_cast<int32_t>(i)) { in concatConstructor() 123 int32_t axis = getRandomAxis(rank); in splitConstructor() local 124 op->inputs[1]->setScalarValue<int32_t>(axis); in splitConstructor() 125 axis = toPositiveAxis(axis, rank); in splitConstructor() 136 if (axis == static_cast<int32_t>(i)) { in splitConstructor()
|
/packages/modules/NeuralNetworks/tools/test_generator/ |
D | README.md | 77 model.Operation("MEAN", i1, [1], 0) # axis = [1], keep_dims = 0 147 …axis in input/output to target position, and optionally remove some axis. The caller need to provi… 155 …axis, such as L2_NORMALIZATION, SOFTMAX, and CHANNEL_SHUFFLE. For example, consider L2_NORMALIZATI… 158 toAxis0 = AxisConverter(-1, 0, 4).Identify([input, output, axis]) 161 The target axis can also be negative to test the negative indexing 164 toAxis0 = AxisConverter(-1, -4, 4).Identify([input, output, axis]) 170 toDim2 = AxisConverter(-1, -1, 4, drop=[0, 1]).Identify([input, output, axis]) 173 …nsposition first and then remove the axis. For example, the following converter will result in sha… 176 toDim2Axis0 = AxisConverter(-1, 2, 4, drop=[0, 1]).Identify([input, output, axis]) 270 # original axis and dim are deduced from the op_list
|