/third_party/mindspore/tests/ut/cpp/parallel/tensor_layout/ |
D | tensor_layout_test.cc | 47 Arrangement tensor_shape; in ReshapeExpandDeviceArrangementTestFunction() local 48 status = tensor_shape.Init(in_tensor_shape_shape); in ReshapeExpandDeviceArrangementTestFunction() 54 tensor_layout.Init(device_arrangement, tensor_map, tensor_shape); in ReshapeExpandDeviceArrangementTestFunction() 59 Arrangement tensor_shape_new = tensor_layout_new_ptr->tensor_shape(); in ReshapeExpandDeviceArrangementTestFunction() 76 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 80 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() 97 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 101 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() 117 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 121 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() [all …]
|
D | redistribution_layout_transfer_test.cc | 49 Arrangement tensor_shape; in RedistributionLayoutTransferTestFunction() local 50 status = tensor_shape.Init(tensor_shape_shape); in RedistributionLayoutTransferTestFunction() 59 status = in_tensor_layout.Init(in_device_arrangement, in_tensor_map, tensor_shape); in RedistributionLayoutTransferTestFunction() 62 status = out_tensor_layout.Init(out_device_arrangement, out_tensor_map, tensor_shape); in RedistributionLayoutTransferTestFunction() 75 Arrangement unified_in_tensor_shape = unified_in.tensor_shape(); in RedistributionLayoutTransferTestFunction() 81 Arrangement unified_out_tensor_shape = unified_out.tensor_shape(); in RedistributionLayoutTransferTestFunction() 90 … const TensorShape &tensor_shape, const DeviceArrangement &out_device_arrangement, in RedistributionLayoutCheck() argument 100 …RedistributionLayoutTransferTestFunction(in_device_arrangement, in_tensor_map, tensor_shape, out_d… in RedistributionLayoutCheck() 135 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 142 …RedistributionLayoutCheck(in_device_arrangement, in_tensor_map, tensor_shape, out_device_arrangeme… in TEST_F() [all …]
|
D | tensor_redistribution_test.cc | 55 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 64 status = in_tensor_shape.Init(tensor_shape); in TEST_F() 80 status = out_tensor_shape.Init(tensor_shape); in TEST_F() 108 TensorShape tensor_shape = {512, 1024}; in TEST_F() local 117 status = in_tensor_shape.Init(tensor_shape); in TEST_F() 133 status = out_tensor_shape.Init(tensor_shape); in TEST_F() 160 TensorShape tensor_shape = {128, 64, 1, 1}; in TEST_F() local 169 status = in_tensor_shape.Init(tensor_shape); in TEST_F() 177 tensor_shape = {128, 64}; in TEST_F() 186 status = out_tensor_shape.Init(tensor_shape); in TEST_F()
|
D | util_layout_gen_test.h | 37 … GenerateValidTensorMap(const DeviceArrangement &device_arrangement, const TensorMap &tensor_shape, 47 const TensorShape &tensor_shape); 50 const TensorShape &tensor_shape); 53 const TensorShape &tensor_shape,
|
D | util_layout_gen_test.cc | 106 …enerateValidTensorMap(const DeviceArrangement &device_arrangement, const TensorShape &tensor_shape, in GenerateValidTensorMap() argument 110 int64_t shape_size = tensor_shape.size(); in GenerateValidTensorMap() 119 TensorMap none_map(tensor_shape.size(), -1); in GenerateValidTensorMap() 177 const TensorShape &tensor_shape) { in CheckLayoutValid() argument 182 if (!ShapeIsDividedByDevice(device_arrangement, tensor_map, tensor_shape)) { in CheckLayoutValid() 199 const TensorShape &tensor_shape) { in ShapeIsDividedByDevice() argument 201 for (uint32_t i = 0; i < tensor_map.size() && i < tensor_shape.size(); i++) { in ShapeIsDividedByDevice() 206 if (tensor_shape[i] % dim != 0) { in ShapeIsDividedByDevice() 237 const TensorShape &tensor_shape, in ComputeAccumDeviceTOAccumShapeMap() argument 241 Status status = ShapeToAccumulateProductReverse(tensor_shape, &shape_accum_reverse); in ComputeAccumDeviceTOAccumShapeMap()
|
D | construct_operator_test.cc | 68 Shape tensor_shape = {512, 1024}; in SetUp() local 72 constructor.UpdateTensorShape(tensor_shape); in SetUp() 91 Arrangement tensor_shape; in TEST_F() local 92 tensor_shape.Init(shape); in TEST_F() 94 tensor_layout.Init(dev_mat, tensor_map, tensor_shape); in TEST_F()
|
D | redistribution_operator_infer_test.cc | 75 Shape tensor_shape = dev_mat; in InferOperatorCheckAll() local 76 GenerateValidTensorMap(dev_mat, tensor_shape, &tensor_map_list); in InferOperatorCheckAll() 82 in_tensor_shape.Init(tensor_shape); in InferOperatorCheckAll()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/control/ |
D | tensorlist_fromtensor_infer.c | 50 vvector tensor_shape; in TensorListFromTensorInferShape() local 51 tensor_shape.size_ = (size_t)(dim0); in TensorListFromTensorInferShape() 52 tensor_shape.shape_ = (int **)malloc(tensor_shape.size_ * sizeof(int *)); in TensorListFromTensorInferShape() 53 if (tensor_shape.shape_ == NULL) { in TensorListFromTensorInferShape() 56 tensor_shape.shape_size_ = (int *)malloc(tensor_shape.size_ * sizeof(int)); in TensorListFromTensorInferShape() 57 if (tensor_shape.shape_size_ == NULL) { in TensorListFromTensorInferShape() 58 free(tensor_shape.shape_); in TensorListFromTensorInferShape() 62 tensor_shape.shape_[i] = (int *)(input0->shape_ + 1); in TensorListFromTensorInferShape() 63 tensor_shape.shape_size_[i] = (int)(input0->shape_size_) - 1; in TensorListFromTensorInferShape() 68 int ret = MallocTensorListData(output, input0->data_type_, &tensor_shape); in TensorListFromTensorInferShape() [all …]
|
/third_party/mindspore/tests/ut/cpp/parallel/auto_parallel/ |
D | rec_partition_test.cc | 75 p_tensor->tensor_shape.shape_n = n; in MakeTensor() 76 p_tensor->tensor_shape.shape_c = c; in MakeTensor() 77 p_tensor->tensor_shape.shape_h = h; in MakeTensor() 78 p_tensor->tensor_shape.shape_w = w; in MakeTensor() 118 p_tensor_out->tensor_shape.shape_w = ARRAY_B; in MakeMatMulData() 119 p_tensor_out->tensor_shape.shape_h = ARRAY_A; in MakeMatMulData() 129 p_tensor0->tensor_shape.shape_w = ARRAY_C; in MakeMatMulData() 130 p_tensor0->tensor_shape.shape_h = ARRAY_A; in MakeMatMulData() 134 p_tensor1->tensor_shape.shape_w = ARRAY_B; in MakeMatMulData() 135 p_tensor1->tensor_shape.shape_h = ARRAY_C; in MakeMatMulData() [all …]
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/ |
D | rec_cost.cc | 44 …double input_tensor = node.apply.arguments[0].tensor_shape.shape_n * node.apply.arguments[0].tenso… in CostRedis() 45 … node.apply.arguments[0].tensor_shape.shape_c * node.apply.arguments[0].tensor_str.str_c * in CostRedis() 46 … node.apply.arguments[0].tensor_shape.shape_h * node.apply.arguments[0].tensor_str.str_h * in CostRedis() 47 … node.apply.arguments[0].tensor_shape.shape_w * node.apply.arguments[0].tensor_str.str_w; in CostRedis() 49 double output_tensor = node.tensor_parm.tensor_shape.shape_n * node.tensor_parm.tensor_str.str_n * in CostRedis() 50 node.tensor_parm.tensor_shape.shape_c * node.tensor_parm.tensor_str.str_c * in CostRedis() 51 node.tensor_parm.tensor_shape.shape_h * node.tensor_parm.tensor_str.str_h * in CostRedis() 52 node.tensor_parm.tensor_shape.shape_w * node.tensor_parm.tensor_str.str_w; in CostRedis() 136 …static_cast<int64_t>(node.apply.arguments[0].tensor_shape.shape_h * node.apply.arguments[0].tensor… in GetOptimalStr() 138 …static_cast<int64_t>(node.apply.arguments[1].tensor_shape.shape_w * node.apply.arguments[1].tensor… in GetOptimalStr() [all …]
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/tflite/ |
D | tflite_split_parser.cc | 47 const auto tensor_shape = shape_tensor->shape; in Parse() local 60 axis += tensor_shape.size(); in Parse() 62 if (axis >= static_cast<int32_t>(tensor_shape.size())) { in Parse() 68 MS_CHECK_GE(static_cast<int>(tensor_shape.size()), axis + 1, nullptr); in Parse() 69 if (tensor_shape.at(axis) % num_splits != 0 && tensor_shape.at(axis) / num_splits != 0) { in Parse() 75 if (tensor_shape[axis] / num_splits != 0) { in Parse() 77 size_splits.push_back(tensor_shape[axis] / num_splits); in Parse()
|
D | tflite_split_v_parser.cc | 55 auto tensor_shape = tensor->shape; in Parse() local 68 axis += tensor_shape.size(); in Parse() 70 if (axis >= static_cast<int32_t>(tensor_shape.size())) { in Parse()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/tf/ |
D | tf_model_parser.cc | 98 auto &tensor_shape = tensor_proto.tensor_shape(); in GetShapeSize() local 100 for (int i = 0; i < tensor_shape.dim_size(); i++) { in GetShapeSize() 101 MS_CHECK_INT_MUL_NOT_OVERFLOW(shape_size, tensor_shape.dim(i).size(), 0); in GetShapeSize() 102 shape_size *= tensor_shape.dim(i).size(); in GetShapeSize() 109 auto &tensor_shape = tensor_proto.tensor_shape(); in SetFloatTensorInfo() local 111 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetFloatTensorInfo() 112 shape_vector.push_back(tensor_shape.dim(i).size()); in SetFloatTensorInfo() 144 auto &tensor_shape = tensor_proto.tensor_shape(); in SetInt32TensorInfo() local 146 for (int i = 0; i < tensor_shape.dim_size(); i++) { in SetInt32TensorInfo() 147 shape_vector.push_back(tensor_shape.dim(i).size()); in SetInt32TensorInfo() [all …]
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/tensor_layout/ |
D | tensor_layout.h | 42 …nit(const Arrangement &device_arrangement, const Map &tensor_map, const Arrangement &tensor_shape); 43 …nitFromVector(const Shape &device_arrangement, const Shape &tensor_map, const Shape &tensor_shape); 65 Arrangement tensor_shape() const { return tensor_shape_; } in tensor_shape() function 74 return (tensor_shape_ == tensor_layout.tensor_shape()); in IsSameTensorShape() 129 …std::shared_ptr<Arrangement> ComputeArrangementByExpandedShape(const Arrangement &tensor_shape) co…
|
D | tensor_layout.cc | 49 const Arrangement &tensor_shape) { in Init() argument 52 tensor_shape_origin_ = tensor_shape; in Init() 55 tensor_shape_ = tensor_shape; in Init() 72 const Shape &tensor_shape) { in InitFromVector() argument 79 if (tensor_shape_origin_.Init(tensor_shape) != SUCCESS) { in InitFromVector() 185 …rangement> TensorLayout::ComputeArrangementByExpandedShape(const Arrangement &tensor_shape) const { in ComputeArrangementByExpandedShape() 186 …red_ptr<std::vector<Arrangement>> expand_list_ptr = tensor_shape_.GetExpandShapeList(tensor_shape); in ComputeArrangementByExpandedShape() 411 Shape tensor_shape(tensor_shape_origin_.array()); in TransferRepeatLayout() local 413 repeat.InitFromVector(dev_mat, tensor_map, tensor_shape); in TransferRepeatLayout()
|
D | redistribution_layout_transfer.cc | 25 Shape from_shape = from_in_.tensor_shape().array(); in CheckValidTransfer() 84 Status status = ExpandShape(unified_device_arrangement_ptr->from_in().tensor_shape().array(), in UnifyDeviceArrangementAndTensorShape() 85 … unified_device_arrangement_ptr->to_in().tensor_shape().array(), &in_expand_shape); in UnifyDeviceArrangementAndTensorShape()
|
D | reshape_layout_transfer.cc | 80 return from_in_.TensorShapeCanBeExpanded(to_in_.tensor_shape()); in FromTensorShapeCanBeExpandByTo() 84 return to_in_.TensorShapeCanBeExpanded(from_in_.tensor_shape()); in ToTensorShapeCanBeExpandByFrom() 142 return from_in_.ComputeExpandedTensorShape(to_in_.tensor_shape()); in ComputeExpandedFromTensorShapeByTo()
|
D | construct_operator.h | 46 void UpdateTensorShape(const Shape &tensor_shape) { tensor_shape_ = tensor_shape; } in UpdateTensorShape() argument
|
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/control/ |
D | tensorlist_fromtensor.cc | 36 std::vector<int> tensor_shape = input0_->shape(); in IsCompatibleShape() local 37 if (static_cast<int>(tensor_shape.size() - 1) != in1_ele_num) { in IsCompatibleShape() 38 MS_LOG(ERROR) << "in_tensors_[0].shape().size() - 1:" << (tensor_shape.size() - 1) in IsCompatibleShape() 47 int dim0 = tensor_shape[i + 1]; in IsCompatibleShape()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/test_data/models/mobilenet_quant/ |
D | mobilenet_v1_1.0_224_quant_eval.pbtxt | 52 tensor_shape { 84 tensor_shape { 113 tensor_shape { 311 tensor_shape { 395 tensor_shape { 427 tensor_shape { 573 tensor_shape { 605 tensor_shape { 751 tensor_shape { 783 tensor_shape { [all …]
|
/third_party/mindspore/tests/st/gnn/ |
D | aggregator.py | 98 tensor_shape = F.shape(x) 99 input_feature = F.reshape(x, (tensor_shape[0] * tensor_shape[1], tensor_shape[2])) 103 output = F.reshape(output, (tensor_shape[0], tensor_shape[1], self.out_channels))
|
/third_party/mindspore/mindspore/lite/tools/converter/legacy_optimizer/graph/ |
D | infershape_pass.cc | 83 std::vector<int32_t> tensor_shape{}; in ConvertTensorList() local 108 tensor_shape = {data[data[kElementShapeIndex] + kFirstElementShapeIndex]}; in ConvertTensorList() 110 lite_tensor = std::make_unique<TensorList>(tensor_shape, element_shape); in ConvertTensorList() 119 if (!tensor_shape.empty() && tensor_shape.front() == -1) { in ConvertTensorList() 122 if (!tensor_shape.empty() && tensor_shape.front() != -1) { in ConvertTensorList() 123 for (int32_t i = 0; i < tensor_shape.front(); ++i) { in ConvertTensorList() 138 auto tensor_shape = tensorT->dims; in ConvertString() local 140 TypeId(tensorT->dataType), tensor_shape, static_cast<mindspore::Format>(tensorT->format), in ConvertString() 166 auto tensor_shape = tensorT->dims; in ConvertOtherTensor() local 168 TypeId(tensorT->dataType), tensor_shape, static_cast<mindspore::Format>(tensorT->format), in ConvertOtherTensor()
|
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/kernels/data/ |
D | data_utils.cc | 688 std::vector<int64_t> tensor_shape = input->shape().AsVector(); in BatchTensorToCVTensorVector() local 690 std::vector<int64_t> index(tensor_shape.size(), 0); in BatchTensorToCVTensorVector() 691 if (tensor_shape.size() <= 1) { in BatchTensorToCVTensorVector() 693 std::to_string(tensor_shape.size())); in BatchTensorToCVTensorVector() 695 TensorShape element_shape(std::vector<int64_t>(tensor_shape.begin() + 1, tensor_shape.end())); in BatchTensorToCVTensorVector() 697 for (; index[0] < tensor_shape[0]; index[0]++) { in BatchTensorToCVTensorVector() 714 std::vector<int64_t> tensor_shape = input->shape().AsVector(); in BatchTensorToTensorVector() local 716 std::vector<int64_t> index(tensor_shape.size(), 0); in BatchTensorToTensorVector() 717 if (tensor_shape.size() <= 1) { in BatchTensorToTensorVector() 719 std::to_string(tensor_shape.size())); in BatchTensorToTensorVector() [all …]
|
/third_party/mindspore/mindspore/core/ir/ |
D | meta_tensor_extends.cc | 35 auto tensor_shape = tens->shape(); in ToAbstract() local 36 auto abs_tensor = std::make_shared<abstract::AbstractTensor>(dtype, tensor_shape); in ToAbstract()
|
/third_party/mindspore/mindspore/lite/src/cxx_api/tensor/ |
D | tensor_impl.h | 132 std::vector<int> tensor_shape; in SetShape() local 133 tensor_shape.resize(shape.size()); in SetShape() 134 …std::transform(shape.begin(), shape.end(), tensor_shape.begin(), [](int64_t c) { return static_cas… in SetShape() 135 lite_tensor_->set_shape(tensor_shape); in SetShape()
|