/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/ |
D | resize_infer.c | 25 const TensorC *shape_tensor = inputs[1]; in HandleTwoInputs() local 26 if (shape_tensor->data_ == NULL) { in HandleTwoInputs() 29 int shape_size = GetElementNum(shape_tensor); in HandleTwoInputs() 32 if (shape_tensor->data_type_ == kNumberTypeInt32) { in HandleTwoInputs() 33 int32_t *data = (int32_t *)(shape_tensor->data_); in HandleTwoInputs() 37 if (GetElementNum(shape_tensor) < 4) { in HandleTwoInputs() 42 } else if (shape_tensor->data_type_ == kNumberTypeFloat32) { in HandleTwoInputs() 43 float *data = (float *)(shape_tensor->data_); in HandleTwoInputs() 52 } else if (shape_tensor->data_type_ == kNumberTypeFloat16) { in HandleTwoInputs() 53 uint16_t *data = (uint16_t *)(shape_tensor->data_); in HandleTwoInputs() [all …]
|
D | broadcast_to_infer.c | 20 int GetShapeByType(const TensorC *shape_tensor, int shape_size, int *dst_shape) { in GetShapeByType() argument 21 if (shape_tensor == NULL || dst_shape == NULL) { in GetShapeByType() 27 NNACL_CHECK_NULL_RETURN_ERR(shape_tensor->data_); in GetShapeByType() 28 switch (shape_tensor->data_type_) { in GetShapeByType() 30 int8_t *data = (int8_t *)(shape_tensor->data_); in GetShapeByType() 36 int32_t *data = (int32_t *)(shape_tensor->data_); in GetShapeByType() 42 int64_t *data = (int64_t *)(shape_tensor->data_); in GetShapeByType() 48 float *data = (float *)(shape_tensor->data_); in GetShapeByType() 54 uint32_t *data = (uint32_t *)(shape_tensor->data_); in GetShapeByType() 171 const TensorC *shape_tensor = inputs[1]; in BroadcastToInferShape() local [all …]
|
D | reshape_infer.c | 91 const TensorC *shape_tensor = inputs[1]; in CalShapeByType() local 100 switch (shape_tensor->data_type_) { in CalShapeByType() 102 int8_t *data = (int8_t *)(shape_tensor->data_); in CalShapeByType() 113 int32_t *data = (int32_t *)(shape_tensor->data_); in CalShapeByType() 124 int64_t *data = (int64_t *)(shape_tensor->data_); in CalShapeByType() 135 float *data = (float *)(shape_tensor->data_); in CalShapeByType() 146 uint32_t *data = (uint32_t *)(shape_tensor->data_); in CalShapeByType() 183 const TensorC *shape_tensor = inputs[1]; in ReshapeInferShape() local 185 …if (shape_tensor->data_ == NULL || (shape_tensor->shape_size_ == 1 && shape_tensor->shape_[0] == 0… in ReshapeInferShape() 191 if (shape_tensor->data_ == NULL) { in ReshapeInferShape() [all …]
|
D | crop_and_resize_infer.c | 51 const TensorC *shape_tensor = inputs[3]; in CropAndResizeInferShape() local 52 int32_t *data = (int32_t *)(shape_tensor->data_); in CropAndResizeInferShape() 56 if (GetElementNum(shape_tensor) < 2) { in CropAndResizeInferShape()
|
/third_party/mindspore/mindspore/lite/test/ut/nnacl/infer/ |
D | reshape_infer_test.cc | 61 std::vector<int32_t> shape_tensor = {6}; in TEST_F() local 62 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 93 std::vector<int8_t> shape_tensor = {6}; in TEST_F() local 94 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 125 std::vector<uint32_t> shape_tensor = {6}; in TEST_F() local 126 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 156 std::vector<float> shape_tensor = {3.0, 4.0}; in TEST_F() local 157 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 188 std::vector<int64_t> shape_tensor = {3, 4}; in TEST_F() local 189 inputs[1]->data_ = shape_tensor.data(); in TEST_F() [all …]
|
D | resize_infer_test.cc | 69 std::vector<int32_t> shape_tensor = {4, 3, 2, 5}; in TEST_F() local 70 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 108 std::vector<float> shape_tensor = {4.0, 3.0, 2.0, 5.0}; in TEST_F() local 109 inputs[1]->data_ = shape_tensor.data(); in TEST_F() 147 std::vector<int32_t> shape_tensor = {4, 3, 2, 5}; in TEST_F() local 148 inputs[1]->data_ = shape_tensor.data(); in TEST_F()
|
/third_party/mindspore/mindspore/lite/src/delegate/npu/op/ |
D | scale_npu.cc | 142 std::shared_ptr<ge::Tensor> shape_tensor = std::make_shared<ge::Tensor>(); in ConvertScaleToMul() local 143 if (shape_tensor == nullptr) { in ConvertScaleToMul() 148 shape_tensor->SetTensorDesc(tensor_desc); in ConvertScaleToMul() 149 …shape_tensor->SetData(reinterpret_cast<const uint8_t *>(valid_shape), NPU_SHAPE_SIZE * sizeof(int)… in ConvertScaleToMul() 155 shape_->set_attr_value(shape_tensor); in ConvertScaleToMul()
|
D | reshape_npu.cc | 27 auto shape_tensor = in_tensors.at(1); in IsSupport() local 28 if (shape_tensor.Data() == nullptr) { in IsSupport()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/ |
D | unify_format.cc | 226 auto shape_tensor = std::dynamic_pointer_cast<tensor::Tensor>(resize_shape_node->default_param()); in ConvertOnnxResizeForConstShape() local 227 if (shape_tensor == nullptr) { in ConvertOnnxResizeForConstShape() 231 …MS_CHECK_TRUE_MSG(shape_tensor->data_c() != nullptr, RET_ERROR, "shape_tensor->data_c() is nullptr… in ConvertOnnxResizeForConstShape() 232 auto shape_data = static_cast<float *>(shape_tensor->data_c()); in ConvertOnnxResizeForConstShape() 234 MS_CHECK_TRUE_MSG(!shape_tensor->shape().empty(), RET_NULL_PTR, "out of range."); in ConvertOnnxResizeForConstShape() 235 if (shape_tensor->shape().at(0) == kNumGatherIndiceSize_4) { in ConvertOnnxResizeForConstShape() 237 } else if (shape_tensor->shape().at(0) == kNumGatherIndiceSize_2) { in ConvertOnnxResizeForConstShape() 244 auto tensor_info = CreateTensorInfo(nullptr, 0, shape_tensor->shape(), shape_tensor->data_type()); in ConvertOnnxResizeForConstShape()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/tflite/ |
D | tflite_split_parser.cc | 42 const auto &shape_tensor = tflite_subgraph->tensors.at(tflite_op->inputs.at(1)); in Parse() local 43 if (shape_tensor == nullptr) { in Parse() 47 const auto tensor_shape = shape_tensor->shape; in Parse()
|
D | tflite_resize_parser.cc | 80 const auto &shape_tensor = tflite_subgraph->tensors[tfliteResizeTensorIndex]; in Parse() local 81 if (shape_tensor == nullptr) { in Parse() 85 auto resizeTensorBufferIndex = shape_tensor->buffer; in Parse()
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/ |
D | resize.cc | 151 auto shape_tensor = in_tensors_[1]; in PreProcess() local 152 if (!shape_tensor->IsConst()) { in PreProcess() 157 shape_tensor->MutableData(); in PreProcess()
|
D | reshape.cc | 124 auto shape_tensor = in_tensors_[1]; in PreProcess() local 125 if (!shape_tensor->IsConst()) { in PreProcess() 130 if (shape_tensor->MutableData() == nullptr) { in PreProcess()
|
/third_party/mindspore/mindspore/lite/src/delegate/tensorrt/op/ |
D | shuffle_tensorrt.cc | 247 mindspore::MSTensor &shape_tensor = in_tensors_[1]; in AddReshapeOp() local 248 if (shape_tensor.Data() != nullptr) { in AddReshapeOp() 250 …nvinfer1::Dims reshape_dims = lite::ConvertCudaDims(shape_tensor.Data().get(), shape_tensor.Elemen… in AddReshapeOp()
|
/third_party/mindspore/mindspore/nn/probability/bijector/ |
D | bijector.py | 144 shape_tensor = self.fill_base(self.parameter_type, shape, 0.0) 147 return (shape_tensor + dist_shape_tensor).shape
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/common/ |
D | helper.cc | 514 auto shape_tensor = std::make_shared<tensor::Tensor>(kNumberTypeInt64, shape_vec_shape); in CreateShapeValueNode() local 515 MS_EXCEPTION_IF_NULL(shape_tensor); in CreateShapeValueNode() 516 auto data_ptr = shape_tensor->data_c(); in CreateShapeValueNode() 519 …auto ret_code = memcpy_s(data_ptr, static_cast<size_t>(shape_tensor->data().nbytes()), &shape[0], … in CreateShapeValueNode() 524 shape_value = shape_tensor; in CreateShapeValueNode()
|
/third_party/mindspore/mindspore/core/abstract/ |
D | prim_arrays.cc | 974 ShapeVector shape_tensor = tensor->shape()->shape(); in InferImplConcat() local 975 int64_t rank_tensor = SizeToLong(shape_tensor.size()); in InferImplConcat() 978 CheckMinMaxShape(shape_tensor, &min_shape_tensor, &max_shape_tensor); in InferImplConcat() 984 if (j != axis_value && shape_tensor[j] != shape_base[j]) { in InferImplConcat() 991 all_shp += shape_tensor[axis_value]; in InferImplConcat()
|