/third_party/mindspore/tests/ut/cpp/parallel/tensor_layout/ |
D | tensor_layout_test.cc | 44 Map tensor_map; in ReshapeExpandDeviceArrangementTestFunction() local 45 status = tensor_map.Init(in_tensor_map_shape); in ReshapeExpandDeviceArrangementTestFunction() 54 tensor_layout.Init(device_arrangement, tensor_map, tensor_shape); in ReshapeExpandDeviceArrangementTestFunction() 57 Map tensor_map_new = tensor_layout_new_ptr->tensor_map(); in ReshapeExpandDeviceArrangementTestFunction() 75 TensorMap tensor_map = {1, 0}; in TEST_F() local 80 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() 96 TensorMap tensor_map = {0, 1}; in TEST_F() local 101 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() 116 TensorMap tensor_map = {1, -1}; in TEST_F() local 121 …ReshapeExpandDeviceArrangementTestFunction(device_arrangement, tensor_map, tensor_shape, device_ar… in TEST_F() [all …]
|
D | util_layout_gen_test.cc | 96 TensorMap tensor_map(map_size, -1); in GenerateTensorMap() local 101 tensor_map[pos_index[i]] = pos_value[i]; in GenerateTensorMap() 103 return tensor_map; in GenerateTensorMap() 142 TensorMap tensor_map = GenerateTensorMap(shape_size, pos_index[j], pos_value[k]); in GenerateValidTensorMap() local 143 tensor_map_list->push_back(tensor_map); in GenerateValidTensorMap() 176 bool CheckLayoutValid(const DeviceArrangement &device_arrangement, const TensorMap &tensor_map, in CheckLayoutValid() argument 179 if ((tensor_map.size() - ComputeNoneNumber(tensor_map)) > device_arrangement.size()) { in CheckLayoutValid() 182 if (!ShapeIsDividedByDevice(device_arrangement, tensor_map, tensor_shape)) { in CheckLayoutValid() 188 size_t ComputeNoneNumber(const TensorMap &tensor_map) { in ComputeNoneNumber() argument 190 for (size_t i = 0; i < tensor_map.size(); i++) { in ComputeNoneNumber() [all …]
|
D | tensor_redistribution_test.cc | 54 TensorMap tensor_map = {2, 0}; in TEST_F() local 61 status = in_tensor_map.Init(tensor_map); in TEST_F() 71 tensor_map = {2, 1}; in TEST_F() 77 status = out_tensor_map.Init(tensor_map); in TEST_F() 107 TensorMap tensor_map = {2, 0}; in TEST_F() local 114 status = in_tensor_map.Init(tensor_map); in TEST_F() 124 tensor_map = {2, 1}; in TEST_F() 130 status = out_tensor_map.Init(tensor_map); in TEST_F() 159 TensorMap tensor_map = {0, -1, -1, -1}; in TEST_F() local 166 status = in_tensor_map.Init(tensor_map); in TEST_F() [all …]
|
D | util_layout_gen_test.h | 44 size_t ComputeNoneNumber(const TensorMap &tensor_map); 46 …ol ShapeIsDividedByDevice(const DeviceArrangement &device_arrangement, const TensorMap &tensor_map, 49 bool CheckLayoutValid(const DeviceArrangement &device_arrangement, const TensorMap &tensor_map, 52 …ccumDeviceTOAccumShapeMap(const DeviceArrangement &device_arrangement, const TensorMap &tensor_map,
|
/third_party/mindspore/tests/ut/cpp/dataset/ |
D | batch_op_test.cc | 63 TensorMap tensor_map; in TEST_F() local 64 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 71 EXPECT_EQ(*t == *tensor_map["col_sint64"], true); in TEST_F() 73 EXPECT_EQ(*t == *tensor_map["col_sint16"], false); in TEST_F() 74 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 76 if (tensor_map.size() == 0) { in TEST_F() 111 TensorMap tensor_map; in TEST_F() local 112 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 114 EXPECT_EQ(*t1 == *(tensor_map["col_sint64"]), true); // first call to getNext() in TEST_F() 116 rc = di.GetNextAsMap(&tensor_map); in TEST_F() [all …]
|
D | image_folder_op_test.cc | 94 TensorMap tensor_map; in TEST_F() local 95 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 99 while (tensor_map.size() != 0) { in TEST_F() 100 tensor_map["label"]->GetItemAt<int32_t>(&label, {}); in TEST_F() 102 …MS_LOG(DEBUG) << "row: " << i << "\t" << tensor_map["image"]->shape() << "label:" << label << "\n"; in TEST_F() 104 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 120 TensorMap tensor_map; in TEST_F() local 121 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 125 while (tensor_map.size() != 0) { in TEST_F() 126 tensor_map["label"]->GetItemAt<int32_t>(&label, {}); in TEST_F() [all …]
|
D | album_op_test.cc | 79 TensorMap tensor_map; in TEST_F() local 80 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 83 while (tensor_map.size() != 0) { in TEST_F() 84 EXPECT_TRUE(tensor_map["label"]->GetItemAt(&label, {0})); in TEST_F() 85 …MS_LOG(DEBUG) << "row: " << i << "\t" << tensor_map["image"]->shape() << "label:" << label << "lab… in TEST_F() 86 << tensor_map["label"] << "\n"; in TEST_F() 88 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 105 TensorMap tensor_map; in TEST_F() local 106 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 109 while (tensor_map.size() != 0) { in TEST_F() [all …]
|
D | manifest_op_test.cc | 74 TensorMap tensor_map; in TEST_F() local 75 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 79 while (tensor_map.size() != 0) { in TEST_F() 80 tensor_map["label"]->GetItemAt<int32_t>(&label, {}); in TEST_F() 82 …MS_LOG(DEBUG) << "row: " << i << "\t" << tensor_map["image"]->shape() << "label:" << label << "\n"; in TEST_F() 84 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 104 TensorMap tensor_map; in TEST_F() local 105 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 109 while (tensor_map.size() != 0) { in TEST_F() 110 tensor_map["label"]->GetItemAt<int32_t>(&label, {}); in TEST_F() [all …]
|
D | map_op_test.cc | 176 TensorMap tensor_map; in TEST_F() local 177 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 179 EXPECT_EQ(tensor_map.size(), 4); in TEST_F() 180 EXPECT_EQ(tensor_map.find("image"), tensor_map.end()); in TEST_F() 181 EXPECT_NE(tensor_map.find("label"), tensor_map.end()); in TEST_F() 182 EXPECT_NE(tensor_map.find("X"), tensor_map.end()); in TEST_F() 183 EXPECT_NE(tensor_map.find("A"), tensor_map.end()); in TEST_F() 184 EXPECT_NE(tensor_map.find("B"), tensor_map.end()); in TEST_F() 224 TensorMap tensor_map; in TEST_F() local 225 rc = di.GetNextAsMap(&tensor_map); in TEST_F() [all …]
|
D | cifar_op_test.cc | 99 TensorMap tensor_map; in TEST_F() local 100 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 105 while (tensor_map.size() != 0 && i < 100) { in TEST_F() 106 tensor_map["label"]->GetItemAt<uint32_t>(&label, {}); in TEST_F() 107 …MS_LOG(DEBUG) << "row: " << i << "\t" << tensor_map["image"]->shape() << "label:" << label << "\n"; in TEST_F() 109 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 128 TensorMap tensor_map; in TEST_F() local 129 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 133 while (tensor_map.size() != 0) { in TEST_F() 134 tensor_map["label"]->GetItemAt<uint32_t>(&label, {}); in TEST_F() [all …]
|
D | celeba_op_test.cc | 82 TensorMap tensor_map; in TEST_F() local 83 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 85 while (tensor_map.size() != 0) { in TEST_F() 88 tensor_map["attr"]->GetItemAt<uint32_t>(&label, {index}); in TEST_F() 92 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 129 TensorMap tensor_map; in TEST_F() local 130 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 132 while (tensor_map.size() != 0) { in TEST_F() 135 tensor_map["attr"]->GetItemAt<uint32_t>(&label, {index}); in TEST_F() 139 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() [all …]
|
D | ir_callback_test.cc | 171 TensorMap tensor_map; in TEST_F() local 172 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 174 while (!tensor_map.empty()) { in TEST_F() 175 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 233 TensorMap tensor_map; in TEST_F() local 236 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() 239 while (tensor_map.size() != 0) { in TEST_F() 240 rc = di.GetNextAsMap(&tensor_map); in TEST_F() 303 TensorMap tensor_map; in TEST_F() local 306 ASSERT_OK(di.GetNextAsMap(&tensor_map)); in TEST_F() [all …]
|
/third_party/mindspore/mindspore/parallel/ |
D | _tensor.py | 22 def _get_tensor_strategy(dev_mat, tensor_map): argument 34 for dim in tensor_map: 42 def _get_tensor_slice_index(device_arrangement, tensor_strategy, tensor_map, rank_index): argument 56 device_coordinate_new = _convert_to_new_device_coordinate(device_coordinate, tensor_map) 100 def _convert_to_new_device_coordinate(device_coordinate, tensor_map): argument 112 for i in range(len(tensor_map)): 113 if tensor_map[len(tensor_map) - 1 - i] != -1: 115 tensor_map[len(tensor_map) - 1 - i]]) 172 def _get_slice_index(dev_mat, tensor_map): argument 184 tensor_strategy = _get_tensor_strategy(dev_mat, tensor_map) [all …]
|
/third_party/mindspore/mindspore/lite/mindir/src/ |
D | mindir_memory_manager.cc | 40 if (tensor_map.find(tensor) != tensor_map.end()) { in CreateTensorFromBuilder() 42 void *flatbuffer_ptr = tensor_map[tensor]; in CreateTensorFromBuilder() 45 tensor_map[tensor] = nullptr; in CreateTensorFromBuilder() 46 tensor_map.erase(tensor_map.find(tensor)); in CreateTensorFromBuilder() 53 tensor_map[tensor_root] = new_memory_ptr; in CreateTensorFromBuilder() 104 if (tensor_map.find(tensor) != tensor_map.end()) { in DeleteTensor() 106 void *flatbuffer_ptr = tensor_map[tensor]; in DeleteTensor() 109 tensor_map[tensor] = nullptr; in DeleteTensor() 110 tensor_map.erase(tensor_map.find(tensor)); in DeleteTensor() 119 ClearMap(tensor_map); in ClearAllMemory()
|
/third_party/mindspore/tests/ut/python/parallel/ |
D | test_combined_tensor.py | 22 tensor_map = [0, 1] 24 tensor = _reshape_param_data(input_tensor, dev_mat, tensor_map) 28 tensor_map = [1, -1] 30 tensor = _reshape_param_data(input_tensor, dev_mat, tensor_map) 47 tensor_map = [-1, -1, -1, -1] 48 tensor = _reshape_param_data(input_tensor, dev_mat, tensor_map)
|
D | test_load_tensor.py | 25 tensor_map = [1, -1] 27 tensor_slice = _load_tensor(tensor, dev_mat, tensor_map) 33 tensor_slice = _load_tensor(tensor, dev_mat, tensor_map)
|
/third_party/mindspore/tests/ut/cpp/parallel/ |
D | device_matrix_test.cc | 88 Shape tensor_map = {-1, 0}; in TEST_F() local 92 arr.GetDevicesByTensorMap(tensor_map, &rank_list); in TEST_F() 99 Shape tensor_map = {1, 0}; in TEST_F() local 103 arr.GetDevicesByTensorMap(tensor_map, &rank_list); in TEST_F() 110 Shape tensor_map = {-1, 0}; in TEST_F() local 114 arr.GetDevicesByTensorMap(tensor_map, &rank_list); in TEST_F()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/tensor_layout/ |
D | tensor_layout.cc | 48 Status TensorLayout::Init(const Arrangement &device_arrangement, const Map &tensor_map, in Init() argument 51 tensor_map_origin_ = tensor_map; in Init() 54 tensor_map_ = tensor_map; in Init() 71 Status TensorLayout::InitFromVector(const Shape &device_arrangement, const Shape &tensor_map, in InitFromVector() argument 76 if (tensor_map_origin_.Init(tensor_map) != SUCCESS) { in InitFromVector() 410 Shape tensor_map(tensor_map_origin_.GetDimSize(), -1); in TransferRepeatLayout() local 413 repeat.InitFromVector(dev_mat, tensor_map, tensor_shape); in TransferRepeatLayout() 421 Shape tensor_map = tensor_map_.array(); in GenerateOptShardSliceShape() local 440 if (tensor_map[0] == MAP_NONE) { in GenerateOptShardSliceShape() 443 split_num = dev_max[dev_max.size() - 1 - static_cast<size_t>(tensor_map[0])] * repeated_num; in GenerateOptShardSliceShape()
|
D | tensor_layout.h | 42 …Status Init(const Arrangement &device_arrangement, const Map &tensor_map, const Arrangement &tenso… 43 …Status InitFromVector(const Shape &device_arrangement, const Shape &tensor_map, const Shape &tenso… 63 Map tensor_map() const { return tensor_map_; } in tensor_map() function 81 …ap(const TensorLayout &tensor_layout) const { return (tensor_map_ == tensor_layout.tensor_map()); } in IsSameTensorMap()
|
/third_party/mindspore/mindspore/lite/src/ |
D | mindrt_executor.cc | 134 for (auto tensor_map : *output_tensor_map_) { in TransferGraphOutput() 135 auto dst_tensor = tensor_map.second; in TransferGraphOutput() 136 auto src_tensor = tensor_map.first; in TransferGraphOutput() 154 for (auto tensor_map : *output_tensor_map_) { in FreeOutputTensor() 155 auto src_tensor = tensor_map.first; in FreeOutputTensor() 156 auto dst_tensor = tensor_map.second; in FreeOutputTensor()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/ops_info/ |
D | topk_info.cc | 65 TensorMap tensor_map; in InferTensorMap() local 74 tensor_map.push_back(size - i - 1); in InferTensorMap() 78 inputs_tensor_map_.push_back(tensor_map); in InferTensorMap() 80 outputs_tensor_map_.push_back(tensor_map); // values in InferTensorMap() 81 outputs_tensor_map_.push_back(tensor_map); // indices in InferTensorMap()
|
D | select_info.cc | 75 TensorMap tensor_map; in InferTensorMap() local 84 tensor_map.push_back(size - i - 1); in InferTensorMap() 88 inputs_tensor_map_.push_back(tensor_map); in InferTensorMap() 90 outputs_tensor_map_.push_back(tensor_map); in InferTensorMap()
|
D | split_info.cc | 116 TensorMap tensor_map; in InferTensorMap() local 124 tensor_map.push_back(size - i - 1); in InferTensorMap() 127 inputs_tensor_map_.push_back(tensor_map); in InferTensorMap() 130 outputs_tensor_map_.push_back(tensor_map); in InferTensorMap()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/ |
D | parameter_manager.cc | 204 Shape tensor_map = tensor_info.tensor_layout().tensor_map().array(); in GetGroupByTensorInfo() local 208 if (dev_matrix.GetDevicesByTensorMap(tensor_map, &group_devices) != SUCCESS) { in GetGroupByTensorInfo() 384 auto tensor_map = tensor_layout->tensor_map().array(); in IsFullySplitParameter() local 389 if (dev_matrix.GetDevicesByTensorMap(tensor_map, &group_devices) != SUCCESS) { in IsFullySplitParameter() 584 auto tensor_map = tensor_layout->tensor_map().array(); in HandleAdaFactorOpt() local 589 tensor_map.pop_back(); in HandleAdaFactorOpt() 594 …(void)tensor_map.erase(tensor_map.begin() + static_cast<different_type>(SECOND_FROM_END(shape_size… in HandleAdaFactorOpt() 601 if (new_tensor_layout.InitFromVector(dev_mat, tensor_map, origin_shape) != SUCCESS) { in HandleAdaFactorOpt()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/graph_util/ |
D | get_parallel_info.cc | 43 auto tensor_map = tensor_layout->tensor_map().array(); in GetParameterLayout() local 49 …py::make_tuple(device_arrangement, tensor_map, slice_shape, field_size, uniform_split, opt_shard_g… in GetParameterLayout()
|