/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/control/ |
D | tensorlist_setitem_infer.c | 72 vvector out_shape; in TensorListSetItemInferShape() local 73 out_shape.size_ = 0; in TensorListSetItemInferShape() 74 out_shape.shape_ = (int **)malloc((input0->element_num_ + 1) * sizeof(int *)); in TensorListSetItemInferShape() 75 if (out_shape.shape_ == NULL) { in TensorListSetItemInferShape() 78 out_shape.shape_size_ = (int *)malloc((input0->element_num_ + 1) * sizeof(int)); in TensorListSetItemInferShape() 79 if (out_shape.shape_size_ == NULL) { in TensorListSetItemInferShape() 80 free(out_shape.shape_); in TensorListSetItemInferShape() 85 out_shape.shape_[out_shape.size_] = (int *)(value_tensor->shape_); in TensorListSetItemInferShape() 86 out_shape.shape_size_[out_shape.size_] = value_tensor->shape_size_; in TensorListSetItemInferShape() 87 out_shape.size_++; in TensorListSetItemInferShape() [all …]
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/cl/ |
D | space_to_depth.cl | 23 int4 out_shape, int block_size, int ci_size) { 27 if (X >= out_shape.w || Y >= out_shape.z || Z >= out_shape.x * out_shape.y) return; 28 if (out_shape.y == 0 || ci_size == 0 || block_size == 0) return; 29 int N = Z / out_shape.y; 30 int H = Z % out_shape.y; 53 WRITE_IMAGE(dst_data, (int2)(Y * out_shape.w + X, Z), result_flt4); 57 int4 out_shape, int block_size, int ci_size) { 61 if (X >= out_shape.w || Y >= out_shape.z || Z >= out_shape.x * out_shape.y) return; 62 if (out_shape.y == 0 || in_shape.w == 0 || block_size == 0) return; 64 int N = Z / out_shape.y; [all …]
|
D | one_hot.cl | 32 … int4 out_shape, int depth, float on_value, float off_value, int C, int support_neg_index) { 36 if (X >= out_shape.w || Y >= out_shape.z || Z >= out_shape.x * out_shape.y) return; 37 int N = Z / out_shape.y; 38 int H = Z % out_shape.y; 39 int in_index = (H * out_shape.z + Y) * out_shape.w + X; 60 WRITE_IMAGE(dst_data, (int2)(Y * out_shape.w + X, Z), result); 64 … int4 out_shape, int depth, float on_value, float off_value, int C, int support_neg_index) { 68 if (X >= out_shape.w || Y >= out_shape.z || Z >= out_shape.x * out_shape.y) return; 69 int N = Z / out_shape.y; 70 int H = Z % out_shape.y; [all …]
|
D | matmul.cl | 21 __read_only image2d_t bias, int4 in_shape, int4 out_shape) { 27 int co4 = UP_DIV(out_shape.w, C4NUM); 28 int n = out_shape.z; 52 __read_only image2d_t bias, int4 in_shape, int4 out_shape) { 59 int co4 = UP_DIV(out_shape.w, C4NUM); 60 int n = out_shape.x; 61 int h = out_shape.y; 62 int w = out_shape.z; 88 int4 out_shape) { 95 int co4 = UP_DIV(out_shape.w, C4NUM); [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/ |
D | reshape_infer.c | 21 int CalShape(const int *data, const TensorC *const *inputs, int *out_shape, size_t *out_shape_size,… in CalShape() argument 33 ShapePush(out_shape, out_shape_size, data[i]); in CalShape() 42 out_shape[index] = input_count / size; in CalShape() 47 int CalNewShape(const TensorC *in_tensor, int *out_shape, size_t out_shape_size) { in CalNewShape() argument 55 if (out_shape[i] == -1) { in CalNewShape() 61 } else if (out_shape[i] < 0) { in CalNewShape() 63 } else if (out_shape[i] == 0) { in CalNewShape() 65 out_shape[i] = in_tensor->shape_[i]; in CalNewShape() 66 out_shape_size_new *= out_shape[i]; in CalNewShape() 72 out_shape_size_new *= (size_t)(out_shape[i]); in CalNewShape() [all …]
|
D | reduce_infer.c | 20 int ReduceOnAllAxes(const TensorC *input, TensorC *output, int *out_shape, size_t out_shape_size, b… in ReduceOnAllAxes() argument 23 ShapePush(out_shape, &out_shape_size, 1); in ReduceOnAllAxes() 26 SetShapeArray(output, out_shape, out_shape_size); in ReduceOnAllAxes() 31 …xes(const TensorC *input, size_t num_axes, const int *actual_axes, TensorC *output, int *out_shape, in ReduceOnSelectedAxes() argument 43 ShapePush(out_shape, &out_shape_size, 1); in ReduceOnSelectedAxes() 46 ShapePush(out_shape, &out_shape_size, input->shape_[i]); in ReduceOnSelectedAxes() 49 SetShapeArray(output, out_shape, out_shape_size); in ReduceOnSelectedAxes() 84 int out_shape[MAX_SHAPE_SIZE] = {0}; in ReduceInferShape() local 87 return ReduceOnAllAxes(input, output, out_shape, out_shape_size, keep_dims); in ReduceInferShape() 132 return ReduceOnAllAxes(input, output, out_shape, out_shape_size, keep_dims); in ReduceInferShape() [all …]
|
D | conv2d_infer.c | 120 int out_shape[MAX_SHAPE_SIZE]; in Conv2dInferShape() local 122 ShapeSet(out_shape, &out_shape_size, input_tensor->shape_, input_tensor->shape_size_); in Conv2dInferShape() 123 out_shape[1] = output_h >= 0 ? output_h : 1; in Conv2dInferShape() 124 out_shape[2] = output_w >= 0 ? output_w : 1; in Conv2dInferShape() 125 out_shape[3] = GetBatch(weight_tensor); in Conv2dInferShape() 126 SetShapeArray(out_tensor, out_shape, out_shape_size); in Conv2dInferShape() 132 param->output_batch_ = out_shape[0]; in Conv2dInferShape() 133 param->output_h_ = out_shape[1]; in Conv2dInferShape() 134 param->output_w_ = out_shape[2]; in Conv2dInferShape() 135 param->output_channel_ = out_shape[3]; in Conv2dInferShape()
|
D | constant_of_shape_infer.c | 39 int out_shape[MAX_SHAPE_SIZE]; in ConstantOfShapeInferShape() local 45 out_shape[i] = in_data[i]; in ConstantOfShapeInferShape() 46 if (out_shape[i] <= 0) { in ConstantOfShapeInferShape() 55 out_shape[i] = in_data[i]; in ConstantOfShapeInferShape() 56 if (out_shape[i] <= 0) { in ConstantOfShapeInferShape() 66 SetShapeArray(out_tensor, out_shape, out_shape_size); in ConstantOfShapeInferShape()
|
D | mean_infer.c | 37 int out_shape[MAX_SHAPE_SIZE] = {0}; in MeanInferShape() local 45 ShapePush(out_shape, &out_shape_size, 1); in MeanInferShape() 48 SetShapeArray(output, out_shape, out_shape_size); in MeanInferShape() 66 ShapePush(out_shape, &out_shape_size, 1); in MeanInferShape() 69 ShapePush(out_shape, &out_shape_size, input->shape_[i]); in MeanInferShape() 72 SetShapeArray(output, out_shape, out_shape_size); in MeanInferShape()
|
D | lstm_infer.c | 45 int out_shape[MAX_SHAPE_SIZE]; in LstmInferShape() local 47 ShapeSet(out_shape, &out_shape_size, input->shape_, input->shape_size_); in LstmInferShape() 48 out_shape[2] = hidden_size; in LstmInferShape() 50 int ret = ShapeInsert(out_shape, &out_shape_size, 1, 2); in LstmInferShape() 55 int ret = ShapeInsert(out_shape, &out_shape_size, 1, 1); in LstmInferShape() 60 SetShapeArray(output, out_shape, out_shape_size); in LstmInferShape()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/ |
D | reduce_fp32_tests.cc | 41 …void Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, float *input_dat… 70 void TestReduceFp32::Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, f… in Prepare() argument 78 out_tensor_.set_shape(out_shape); in Prepare() 111 std::vector<int> out_shape{2, 1, 4, 3}; in TEST_F() local 119 …Prepare(in_shape, out_shape, in, out, ReduceMode_ReduceMean, axes, axis_num, reduce_to_end, coeff); in TEST_F() 138 std::vector<int> out_shape{2, 1, 1, 1}; in TEST_F() local 146 …Prepare(in_shape, out_shape, in, out, ReduceMode_ReduceMean, axes, axis_num, reduce_to_end, coeff); in TEST_F() 166 std::vector<int> out_shape{2, 1, 4, 3}; in TEST_F() local 174 …Prepare(in_shape, out_shape, in, out, ReduceMode_ReduceMean, axes, axis_num, reduce_to_end, coeff); in TEST_F() 193 std::vector<int> out_shape{1, 1, 1, 1}; in TEST_F() local [all …]
|
D | crop_fp32_test.cc | 33 int out_shape[4] = {2, 1, 1, 1}; in TEST_F() local 40 Crop4D(input, output, in_shape, out_shape, &crop_param, 0); in TEST_F() 55 int out_shape[4] = {1, 1, 2, 2}; in TEST_F() local 63 Crop4D(input, output, in_shape, out_shape, &crop_param, 0); in TEST_F() 78 int out_shape[4] = {2, 2, 2, 1}; in TEST_F() local 83 Crop4D(input, output, in_shape, out_shape, &crop_param, 0); in TEST_F() 98 int out_shape[4] = {2, 2, 2, 1}; in TEST_F() local 103 Crop4D(input, output, in_shape, out_shape, &crop_param, 0); in TEST_F() 104 Crop4D(input, output, in_shape, out_shape, &crop_param, 1); in TEST_F() 119 int out_shape[4] = {2, 1, 1, 1}; in TEST_F() local [all …]
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/ |
D | transpose_fp32.cc | 68 auto out_shape = outTensor->shape(); in ReSize() local 73 MS_CHECK_LE(static_cast<size_t>(param_->num_axes_), out_shape.size(), RET_ERROR); in ReSize() 76 param_->out_strides_[i] = out_shape.at(i + 1) * param_->out_strides_[i + 1]; in ReSize() 84 out_shape_ = reinterpret_cast<int *>(malloc(out_shape.size() * sizeof(int))); in ReSize() 89 memcpy(out_shape_, out_shape.data(), in_shape.size() * sizeof(int)); in ReSize() 125 auto out_shape = out_tensor->shape(); in GetNHNCTransposeFunc() local 127 nhnc_param_[0] = out_shape[0]; in GetNHNCTransposeFunc() 128 MS_CHECK_FALSE(INT_MUL_OVERFLOW(out_shape[1], out_shape[2]), RET_ERROR); in GetNHNCTransposeFunc() 129 nhnc_param_[1] = out_shape[1] * out_shape[2]; in GetNHNCTransposeFunc() 130 nhnc_param_[2] = out_shape[3]; in GetNHNCTransposeFunc() [all …]
|
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/nnacl/int8/ |
D | transpose_int8_coder.cc | 30 auto out_shape = out_tensor->shape(); in Prepare() local 45 param_->out_strides_[i] = out_shape.at(i + 1) * param_->out_strides_[i + 1]; in Prepare() 68 auto out_shape = output_tensors_[0]->shape(); in DoCode() local 70 code.CodeFunction("PackNCHWToNHWCInt8", input_tensors_[0], output_tensors_[0], out_shape[0], in DoCode() 71 out_shape[1] * out_shape[2], out_shape[3]); in DoCode() 73 code.CodeFunction("PackNHWCToNCHWInt8", input_tensors_[0], output_tensors_[0], out_shape[0], in DoCode() 74 out_shape[2] * out_shape[3], out_shape[1]); in DoCode()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/ |
D | resize.cc | 39 auto out_shape = out_tensors_[0]->shape(); in CheckSpecs() local 40 …if (in_shape.size() != DIMENSION_4D || out_shape.size() != DIMENSION_4D || in_shape[0] != out_shap… in CheckSpecs() 41 in_shape[3] != out_shape[3]) { in CheckSpecs() 95 auto out_shape = out_tensors_[0]->shape(); in SetConstArgs() local 97 MS_CHECK_GE(out_shape.size(), DIMENSION_4D, RET_ERROR); in SetConstArgs() 98 int n = out_shape[0]; in SetConstArgs() 99 int h = out_shape[1]; in SetConstArgs() 100 int w = out_shape[2]; in SetConstArgs() 101 int c = out_shape[3]; in SetConstArgs() 126 auto out_shape = GpuTensorInfo(out_tensors_[0]); in SetGlobalLocal() local [all …]
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/ |
D | resize_nearest_neighbor_int8_tests.cc | 32 …void Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, int8_t *input_da… 50 …zeNearestNeighborInt8::Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, in Prepare() argument 60 out_tensor.set_shape(out_shape); in Prepare() 68 param_.new_width_ = out_shape[2]; in Prepare() 69 param_.new_height_ = out_shape[1]; in Prepare() 92 std::vector<int> out_shape = {1, 4, 4, 1}; in TEST_F() local 102 Prepare(in_shape, out_shape, input_data, output_data, quant_in, quant_out, false, thread_num); in TEST_F() 112 std::vector<int> out_shape = {2, 4, 4, 5}; in TEST_F() local 128 Prepare(in_shape, out_shape, input_data, output_data, quant_in, quant_out, false, thread_num); in TEST_F() 138 std::vector<int> out_shape = {2, 4, 4, 5}; in TEST_F() local [all …]
|
D | resize_bilinear_int8_tests.cc | 33 …void Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, int8_t *input_da… 55 …estResizeBilinearInt8::Prepare(const std::vector<int> &in_shape, const std::vector<int> &out_shape, in Prepare() argument 65 out_tensor.set_shape(out_shape); in Prepare() 73 param_.new_width_ = out_shape[2]; in Prepare() 74 param_.new_height_ = out_shape[1]; in Prepare() 92 std::vector<int> out_shape = {1, 4, 4, 1}; in TEST_F() local 99 …Prepare(in_shape, out_shape, input_data, output_data, quant_in, quant_out, align_corners, thread_n… in TEST_F() 108 std::vector<int> out_shape = {2, 4, 4, 5}; in TEST_F() local 124 …Prepare(in_shape, out_shape, input_data, output_data, quant_in, quant_out, align_corners, thread_n… in TEST_F() 133 std::vector<int> out_shape = {2, 4, 4, 5}; in TEST_F() local [all …]
|
/third_party/mindspore/mindspore/core/ops/ |
D | depth_to_space.cc | 67 auto out_shape = x_shape; in DepthToSpaceInfer() local 68 out_shape[1] /= block_size * block_size; in DepthToSpaceInfer() 69 out_shape[2] *= block_size; in DepthToSpaceInfer() 70 out_shape[3] *= block_size; in DepthToSpaceInfer() 72 out_shape = {out_shape[0], out_shape[2], out_shape[3], out_shape[1]}; in DepthToSpaceInfer() 75 ret->set_shape(std::make_shared<abstract::Shape>(out_shape)); in DepthToSpaceInfer()
|
D | dropout.cc | 48 std::vector<int64_t> out_shape; in DropoutInfer() local 49 (void)out_shape.insert(out_shape.end(), x_shape.begin(), x_shape.end()); in DropoutInfer() 50 (void)out_shape.insert(out_shape.end(), x_shape.begin(), x_shape.end()); in DropoutInfer() 51 auto infer_shape = std::make_shared<abstract::Shape>(out_shape); in DropoutInfer()
|
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/nnacl/fp32/ |
D | transpose_fp32_coder.cc | 41 auto out_shape = output_tensor_->shape(); in Resize() local 47 param_->out_strides_[i] = out_shape.at(i + 1) * param_->out_strides_[i + 1]; in Resize() 51 …reinterpret_cast<int *>(allocator_->Malloc(kNumberTypeInt32, out_shape.size() * sizeof(int), kOffl… in Resize() 53 memcpy(out_shape_, out_shape.data(), in_shape.size() * sizeof(int)); in Resize() 69 auto out_shape = output_tensor_->shape(); in GetNHNCTransposeFunc() local 72 nhnc_param_[0] = out_shape[0]; in GetNHNCTransposeFunc() 73 nhnc_param_[1] = out_shape[1] * out_shape[2]; in GetNHNCTransposeFunc() 74 nhnc_param_[2] = out_shape[3]; in GetNHNCTransposeFunc() 81 nhnc_param_[0] = out_shape[0]; in GetNHNCTransposeFunc() 82 nhnc_param_[1] = out_shape[2] * out_shape[3]; in GetNHNCTransposeFunc() [all …]
|
/third_party/mindspore/mindspore/_extends/graph_kernel/expanders/ |
D | squeeze.py | 25 out_shape = self.infer_shape(input_x.shape, self.attrs['axis']) 26 result = graph_builder.emit('Reshape', [input_x], attrs={'shape': out_shape}) 35 out_shape = [d for d in shape if d != 1] 38 out_shape = [shape[i] for i in range(ndim) if not (i in axis or (i - ndim) in axis)] 39 if not out_shape: 40 out_shape = [1] 41 return out_shape
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp32/ |
D | crop_fp32.c | 33 void Crop4D(const float *input, float *output, const int *in_shape, const int *out_shape, in Crop4D() argument 37 int out_shape1 = out_shape[1]; in Crop4D() 38 int out_shape2 = out_shape[2]; in Crop4D() 39 int out_shape3 = out_shape[3]; in Crop4D() 52 for (int i = 0; i < out_shape[0]; ++i) { in Crop4D() 71 void Crop4DNoParallel(const float *input, float *output, const int *in_shape, const int *out_shape, in Crop4DNoParallel() argument 80 size_t copy_num = out_shape[3]; in Crop4DNoParallel() 82 size_t in_dim0_end = offset_pad[0] + out_shape[0]; in Crop4DNoParallel() 83 size_t in_dim1_end = offset_pad[1] + out_shape[1]; in Crop4DNoParallel() 84 size_t in_dim2_end = offset_pad[2] + out_shape[2]; in Crop4DNoParallel()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/int8/ |
D | transpose_int8.cc | 52 auto out_shape = out_tensor->shape(); in ReSize() local 69 transpose_param_->out_strides_[i] = out_shape.at(i + 1) * transpose_param_->out_strides_[i + 1]; in ReSize() 86 auto out_shape = out_tensor->shape(); in GetNHNCTransposeFunc() local 89 nhnc_param_[0] = out_shape[0]; in GetNHNCTransposeFunc() 90 nhnc_param_[1] = out_shape[1] * out_shape[2]; in GetNHNCTransposeFunc() 91 nhnc_param_[2] = out_shape[3]; in GetNHNCTransposeFunc() 96 nhnc_param_[0] = out_shape[0]; in GetNHNCTransposeFunc() 97 nhnc_param_[1] = out_shape[2] * out_shape[3]; in GetNHNCTransposeFunc() 98 nhnc_param_[2] = out_shape[1]; in GetNHNCTransposeFunc()
|
/third_party/mindspore/mindspore/lite/src/delegate/tensorrt/op/ |
D | resize_tensorrt.cc | 93 std::vector<float> out_shape; in SetOutputDims() local 111 out_shape.push_back(*(shape_data_fp32 + i)); in SetOutputDims() 118 out_shape.push_back(ShortToFloat32(*(shape_data_fp16 + i))); in SetOutputDims() 127 if (SameDims(out_shape, out_tensors_[0].Shape())) { in SetOutputDims() 129 resize_layer->setOutputDimensions(ConvertCudaDims(out_shape)); in SetOutputDims() 130 } else if (IsScaleOutputDim(in_tensors_[0].Shape(), out_tensors_[0].Shape(), out_shape)) { in SetOutputDims() 132 if (out_shape.size() > DIMENSION_4D) { in SetOutputDims() 137 std::copy(out_shape.begin(), out_shape.end(), scales); in SetOutputDims() 138 resize_layer->setScales(scales, out_shape.size()); in SetOutputDims() 148 …orRT::IsScaleOutputDim(const std::vector<int64_t> &in_shape, const std::vector<int64_t> &out_shape, in IsScaleOutputDim() argument [all …]
|
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/base/ |
D | strided_slice_base_coder.cc | 46 std::vector<int> out_shape = output_tensor_->shape(); in MatchFastPattern() local 47 if (in_shape.size() != out_shape.size()) { in MatchFastPattern() 52 if (in_shape[i] != out_shape[i]) { in MatchFastPattern() 65 std::vector<int> out_shape = output_tensor_->shape(); in InitFastRunParam() local 78 cal_num_per_thread_ = UP_DIV(out_shape[split_axis_], thread_num); in InitFastRunParam() 101 std::vector<int> out_shape = output_tensor_->shape(); in DoFastCode() local 120 << " + " << caled_num * out_shape[split_axis_] * inner_size_ << ";\n"; in DoFastCode() 121 code.CodeFunction("FastStride", "cur_in_ptr", "cur_out_ptr", out_shape.at(split_axis_), in DoFastCode() 125 int cal_axis_num = out_shape.at(split_axis_) - caled_num; in DoFastCode()
|