Home
last modified time | relevance | path

Searched refs:shape (Results 1 – 25 of 58) sorted by relevance

123

/frameworks/ml/nn/common/
DCpuExecutor.cpp71 bool setOutputShape(uint32_t index, const Shape& shape) override;
113 return getInputInfo(index)->shape(); in getInputShape()
129 return getOutputInfo(index)->shape(); in getOutputShape()
154 bool setInfoAndAllocateIfNeeded(RunTimeOperandInfo* info, const Shape& shape, int* result) { in setInfoAndAllocateIfNeeded() argument
158 if (info->type != shape.type) { in setInfoAndAllocateIfNeeded()
163 if (info->scale != shape.scale) { in setInfoAndAllocateIfNeeded()
168 if (info->zeroPoint != shape.offset) { in setInfoAndAllocateIfNeeded()
173 if (info->extraParams != shape.extraParams) { in setInfoAndAllocateIfNeeded()
180 auto combined = combineDimensions(shape.dimensions, info->dimensions); in setInfoAndAllocateIfNeeded()
187 info->type = shape.type; in setInfoAndAllocateIfNeeded()
[all …]
DIndexedShapeWrapper.cpp24 IndexedShapeWrapper::IndexedShapeWrapper(const Shape& wrapped_shape) : shape(&wrapped_shape) { in IndexedShapeWrapper()
25 strides.resize(shape->dimensions.size()); in IndexedShapeWrapper()
28 strides[i] = shape->dimensions[i + 1] * strides[i + 1]; in IndexedShapeWrapper()
37 if (index->at(i) < shape->dimensions[i] - 1) { in nextIndexInplace()
48 if (index->at(i) == shape->dimensions[i]) { in nextIndexInplace()
75 uint32_t currentDimSize = shape->dimensions[shape->dimensions.size() - i]; in broadcastedIndexToFlatIndex()
85 if (index.size() != shape->dimensions.size()) { in isValid()
88 << toString(shape->dimensions); in isValid()
92 if (index[i] >= shape->dimensions[i]) { in isValid()
94 << " is out of range for shape: " << toString(shape->dimensions); in isValid()
DOperationsUtils.cpp136 uint32_t getNumberOfElements(const Shape& shape) { in getNumberOfElements() argument
138 for (size_t i = 0; i < shape.dimensions.size(); i++) { in getNumberOfElements()
139 count *= shape.dimensions[i]; in getNumberOfElements()
144 uint32_t getNumberOfElements(const Shape& shape, size_t firstAxisInclusive, in getNumberOfElements() argument
148 nnAssert(lastAxisExclusive <= shape.dimensions.size()); in getNumberOfElements()
151 count *= shape.dimensions[i]; in getNumberOfElements()
156 uint32_t getNumberOfDimensions(const Shape& shape) { in getNumberOfDimensions() argument
157 return shape.dimensions.size(); in getNumberOfDimensions()
160 uint32_t getSizeOfDimension(const Shape& shape, uint32_t dimensionIdx) { in getSizeOfDimension() argument
161 nnAssert(0 <= dimensionIdx && dimensionIdx < shape.dimensions.size()); in getSizeOfDimension()
[all …]
/frameworks/ml/nn/common/include/
DCpuOperationUtils.h34 inline tflite::Dims<4> convertShapeToDims(const Shape& shape) { in convertShapeToDims() argument
35 nnAssert(shape.dimensions.size() <= 4); in convertShapeToDims()
40 int src = static_cast<int>(shape.dimensions.size()) - i - 1; in convertShapeToDims()
42 dims.sizes[i] = static_cast<int>(getSizeOfDimension(shape, src)); in convertShapeToDims()
55 inline tflite::RuntimeShape convertShapeToTflshape(const Shape& shape) { in convertShapeToTflshape() argument
56 std::vector<int32_t> tflShapeDim(shape.dimensions.begin(), shape.dimensions.end()); in convertShapeToTflshape()
161 bool initialize(const T* data, const Shape& shape) { in initialize() argument
163 mShape = shape; in initialize()
165 return convertNchwToNhwc(mDataOriginal, shape, &mDataNhwc, &mShape); in initialize()
185 bool initialize(T* data, const Shape& shape) { in initialize() argument
[all …]
DOperationsUtils.h105 virtual bool setOutputShape(uint32_t index, const Shape& shape) = 0;
147 uint32_t getNumberOfElements(const Shape& shape);
148 uint32_t getNumberOfElements(const Shape& shape, size_t firstAxisInclusive,
151 uint32_t getNumberOfDimensions(const Shape& shape);
153 uint32_t getSizeOfDimension(const Shape& shape, uint32_t dimensionIdx);
155 uint32_t hasKnownRank(const Shape& shape);
160 inline bool handleNegativeAxis(const Shape& shape, int32_t* axis) { in handleNegativeAxis() argument
161 return handleNegativeAxis(getNumberOfDimensions(shape), axis); in handleNegativeAxis()
342 inline bool transposeFirstTwoDimensions(const T* buffer, const Shape& shape, T* transposedBuffer) { in transposeFirstTwoDimensions() argument
343 const int numDims = getNumberOfDimensions(shape); in transposeFirstTwoDimensions()
[all …]
/frameworks/av/services/camera/libcameraservice/tests/
DDistortionMapperComp.py36 f.write('std::array<int32_t, %d> rawCoords = {\n' % (rawCoords.shape[0] * rawCoords.shape[1]))
37 for i in range(rawCoords.shape[0]):
41 f.write('std::array<int32_t, %d> expCoords = {\n' % (expCoords.shape[0] * expCoords.shape[2]))
42 for i in range(expCoords.shape[0]):
/frameworks/ml/nn/common/operations/
DBidirectionalSequenceLSTM.cpp337 NN_CHECK_EQ(aux_input_->shape().dimensions[0], input_->shape().dimensions[0]); in Prepare()
338 NN_CHECK_EQ(aux_input_->shape().dimensions[1], input_->shape().dimensions[1]); in Prepare()
383 const Shape& inputShape = input_->shape(); in Prepare()
420 *fwOutputActivationState = fw_activation_state_->shape(); in Prepare()
421 *fwOutputCellState = fw_cell_state_->shape(); in Prepare()
422 *bwOutputActivationState = bw_activation_state_->shape(); in Prepare()
423 *bwOutputCellState = bw_cell_state_->shape(); in Prepare()
443 std::vector<uint32_t> fw_output_dims = input_->shape().dimensions; in Eval()
460 Shape bwInputShape = input_->shape(); in Eval()
464 bwInputShape = aux_input_->shape(); in Eval()
[all …]
DRNN.cpp72 const Shape& inputShape = input->shape(); in Prepare()
88 RNNStep<_Float16>(reinterpret_cast<_Float16*>(input_->buffer), input_->shape(), in Eval()
91 reinterpret_cast<_Float16*>(weights_->buffer), weights_->shape(), in Eval()
93 recurrent_weights_->shape(), activation_, in Eval()
96 sizeof(_Float16) * getNumberOfElements(output_->shape())); in Eval()
100 RNNStep<float>(reinterpret_cast<float*>(input_->buffer), input_->shape(), in Eval()
103 reinterpret_cast<float*>(weights_->buffer), weights_->shape(), in Eval()
105 recurrent_weights_->shape(), activation_, in Eval()
108 sizeof(float) * getNumberOfElements(output_->shape())); in Eval()
DSVDF.cpp97 const Shape& inputShape = input->shape(); in Prepare()
116 std::vector<float> inputDataFloat32(getNumberOfElements(input_->shape())); in Eval()
118 std::vector<float> inputStateDataFloat32(getNumberOfElements(state_in_->shape())); in Eval()
121 std::vector<float> biasDataFloat32(getNumberOfElements(bias_->shape())); in Eval()
127 getNumberOfElements(weights_feature_->shape())); in Eval()
130 std::vector<float> weightsTimeDataFloat32(getNumberOfElements(weights_time_->shape())); in Eval()
133 std::vector<float> outputDataFloat32(getNumberOfElements(output_->shape())); in Eval()
134 std::vector<float> outputStateDataFloat32(getNumberOfElements(state_out_->shape())); in Eval()
DLogSoftmax.cpp43 inline bool compute(const T* input, const Shape& shape, T beta, uint32_t axis, T* output) { in compute() argument
44 const uint32_t outerSize = getNumberOfElements(shape, 0, axis); in compute()
45 const uint32_t axisSize = getSizeOfDimension(shape, axis); in compute()
46 const uint32_t innerSize = getNumberOfElements(shape, axis + 1, getNumberOfDimensions(shape)); in compute()
DQuantizedLSTMTest.cpp33 std::vector<uint32_t> shape; member
37 OperandTypeParams(Type type, std::vector<uint32_t> shape, float scale, int32_t zeroPoint) in OperandTypeParams()
38 : type(type), shape(shape), scale(scale), zeroPoint(zeroPoint) {} in OperandTypeParams()
55 OperandType curType(curOTP.type, curOTP.shape, curOTP.scale, curOTP.zeroPoint); in QuantizedLSTMOpModel()
59 const uint32_t numBatches = inputOperandTypeParams[0].shape[0]; in QuantizedLSTMOpModel()
60 inputSize_ = inputOperandTypeParams[0].shape[0]; in QuantizedLSTMOpModel()
62 inputOperandTypeParams[QuantizedLSTMCell::kPrevCellStateTensor].shape[1]; in QuantizedLSTMOpModel()
187 for (int d : params.shape) { in initializeInputData()
DEmbeddingLookup.cpp41 const int row_size = value_->shape().dimensions[0]; in Eval()
45 for (uint32_t i = 0; i < lookup_->shape().dimensions[0]; i++) { in Eval()
DQuantizedLSTM.cpp213 const std::vector<uint32_t> submatrixDims = submatrix->shape().dimensions; in assignWeightsSubmatrix()
335 *cellStateOutShape = prevCellState->shape(); in prepare()
336 *outputShape = prevOutput->shape(); in prepare()
415 GetBuffer<const uint8_t>(input_), convertShapeToDims(input_->shape()), in eval()
416 GetBuffer<const uint8_t>(prevOutput_), convertShapeToDims(prevOutput_->shape()), in eval()
419 convertShapeToDims(prevCellState_->shape()), in eval()
421 GetBuffer<int16_t>(cellStateOut_), convertShapeToDims(cellStateOut_->shape()), in eval()
422 GetBuffer<uint8_t>(output_), convertShapeToDims(output_->shape()), concatTemp.data(), in eval()
DHashtableLookup.cpp51 const int num_rows = value_->shape().dimensions[0]; in Eval()
56 for (int i = 0; i < static_cast<int>(lookup_->shape().dimensions[0]); i++) { in Eval()
DLogicalNot.cpp37 bool compute(const bool8* input, const Shape& shape, bool8* output) { in compute() argument
38 const auto size = getNumberOfElements(shape); in compute()
/frameworks/base/graphics/java/android/graphics/drawable/shapes/
DRoundRectShape.java135 final RoundRectShape shape = (RoundRectShape) super.clone(); in clone() local
136 shape.mOuterRadii = mOuterRadii != null ? mOuterRadii.clone() : null; in clone()
137 shape.mInnerRadii = mInnerRadii != null ? mInnerRadii.clone() : null; in clone()
138 shape.mInset = new RectF(mInset); in clone()
139 shape.mInnerRect = new RectF(mInnerRect); in clone()
140 shape.mPath = new Path(mPath); in clone()
141 return shape; in clone()
DShape.java129 Shape shape = (Shape) o; in equals() local
130 return Float.compare(shape.mWidth, mWidth) == 0 in equals()
131 && Float.compare(shape.mHeight, mHeight) == 0; in equals()
DRectShape.java64 final RectShape shape = (RectShape) super.clone(); in clone() local
65 shape.mRect = new RectF(mRect); in clone()
66 return shape; in clone()
DPathShape.java75 final PathShape shape = (PathShape) super.clone(); in clone() local
76 shape.mPath = new Path(mPath); in clone()
77 return shape; in clone()
/frameworks/ml/nn/runtime/test/specs/V1_2/
Dsub_v1_2.mod.py37 shape = "{2, 4, 16, 2}, 0.5, 0" variable
38 input0 = Input("input0", "TENSOR_QUANT8_ASYMM", shape)
39 input1 = Input("input1", "TENSOR_QUANT8_ASYMM", shape)
41 output0 = Output("output0", "TENSOR_QUANT8_ASYMM", shape)
/frameworks/ml/nn/tools/api/
Dtypes.spec330 * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying
359 * * 0: A 4-D tensor, of shape [batches, height, width, depth], specifying
383 * * 0: The output 4-D tensor, of shape
419 * * 0 ~ n-1: The list of n input tensors, of shape
441 * tensors. The output shape is [D0, D1, ..., sum(Daxis(i)), ..., Dm].
1020 * * 1: A 2-D tensor, specifying the weights, of shape
1023 * * 2: A 1-D tensor, of shape [num_units], specifying the bias. For input
1039 * * 0: The output tensor, of shape [batch_size, num_units]. %{BeforeAPILevel29For}
1064 * For example, if Values has shape of [40, 200, 300],
1065 * Keys should have a shape of [40]. If Lookups tensor has shape
[all …]
/frameworks/ml/nn/runtime/test/specs/V1_3/
Dsub_quant8_signed.mod.py86 shape = "{2, 4, 16, 2}, 0.5, -128" variable
87 input0 = Input("input0", "TENSOR_QUANT8_ASYMM_SIGNED", shape)
88 input1 = Input("input1", "TENSOR_QUANT8_ASYMM_SIGNED", shape)
90 output0 = Output("output0", "TENSOR_QUANT8_ASYMM_SIGNED", shape)
/frameworks/base/graphics/java/android/graphics/
DPathDashPathEffect.java42 public PathDashPathEffect(Path shape, float advance, float phase, in PathDashPathEffect() argument
44 native_instance = nativeCreate(shape.readOnlyNI(), advance, phase, in PathDashPathEffect()
/frameworks/base/core/java/android/widget/
DSmartSelectSprite.java320 for (final RoundedRectangleShape shape : rectangles) { in generateOutlinePolygonPath()
322 rectanglePath.addRect(shape.mBoundingRectangle, Path.Direction.CW); in generateOutlinePolygonPath()
404 final RoundedRectangleShape shape = new RoundedRectangleShape( in startAnimation() local
409 cornerAnimators.add(createCornerAnimator(shape, updateListener)); in startAnimation()
410 shapes.add(shape); in startAnimation()
500 final RoundedRectangleShape shape, in createCornerAnimator() argument
503 shape, in createCornerAnimator()
505 shape.getRoundRatio(), 0.0F); in createCornerAnimator()
/frameworks/base/core/jni/android/graphics/
DPathEffect.cpp52 const SkPath* shape = reinterpret_cast<SkPath*>(shapeHandle); in OneD_constructor() local
53 SkASSERT(shape != NULL); in OneD_constructor()
54 SkPathEffect* effect = SkPath1DPathEffect::Make(*shape, advance, phase, in OneD_constructor()

123