/third_party/mindspore/mindspore/core/abstract/ |
D | utils.cc | 55 ShapePtr CalculateDynamicShape(const ShapePtr &shape1, const ShapePtr &shape2, const ShapeVector &d… in CalculateDynamicShape() argument 59 MS_EXCEPTION_IF_NULL(shape1); in CalculateDynamicShape() 66 if (shape1->shape()[i] != Shape::SHP_ANY && shape2->shape()[i] != Shape::SHP_ANY) { in CalculateDynamicShape() 67 min_dims[i] = std::min(shape1->shape()[i], shape2->shape()[i]); in CalculateDynamicShape() 68 max_dims[i] = std::max(shape1->shape()[i], shape2->shape()[i]); in CalculateDynamicShape() 71 if (shape1->shape()[i] == Shape::SHP_ANY && shape2->shape()[i] != Shape::SHP_ANY) { in CalculateDynamicShape() 72 if (shape1->min_shape().size() <= i || shape1->max_shape().size() <= i) { in CalculateDynamicShape() 73 MS_EXCEPTION(ValueError) << "Shape " << shape1->ToString() in CalculateDynamicShape() 76 min_dims[i] = std::min(shape1->min_shape()[i], shape2->shape()[i]); in CalculateDynamicShape() 77 max_dims[i] = std::max(shape1->max_shape()[i], shape2->shape()[i]); in CalculateDynamicShape() [all …]
|
/third_party/mindspore/tests/ut/python/pynative_mode/nn/ |
D | test_layernorm.py | 26 shape1 = x.shape[1:] 27 m = nn.LayerNorm(shape1, -1, 1) 34 shape1 = x.shape[1:] 35 m = nn.LayerNorm(shape1, begin_params_axis=1) 42 shape1 = (10, 10) 43 m = nn.LayerNorm(shape1, begin_params_axis=2)
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/math/ |
D | broadcast_gpu_kernel.h | 73 auto shape1 = AnfAlgo::GetInputRealDeviceShapeIfExist(kernel_node, 0); in Init() local 76 … is_null_input_ = CHECK_NULL_INPUT(shape1) || CHECK_NULL_INPUT(shape2) || CHECK_NULL_INPUT(shape3); in Init() 82 need_broadcast_ = AnfAlgo::IsTensorBroadcast(shape1, shape2); in Init() 83 if (need_broadcast_ && shape1.size() > MAX_DIMS) { in Init() 85 << shape1.size(); in Init() 101 int lhs_offset = shape3.size() - shape1.size(); in Init() 102 for (size_t j = 0; j < shape1.size(); j++) { in Init() 105 lhs_shape_[j + lhs_offset] = shape1[j]; in Init() 111 input1_num_ *= shape1[j]; in Init()
|
D | broadcast_complex_gpu_kernel.h | 61 auto shape1 = AnfAlgo::GetInputRealDeviceShapeIfExist(kernel_node, 0); in Init() local 64 need_broadcast_ = AnfAlgo::IsTensorBroadcast(shape1, shape2); in Init() 65 if (need_broadcast_ && shape1.size() > MAX_DIMS) { in Init() 78 int lhs_offset = shape3.size() - shape1.size(); in Init() 79 for (size_t j = 0; j < shape1.size(); j++) { in Init() 81 lhs_shape_[j + lhs_offset] = shape1[j]; in Init() 83 input1_num_ *= shape1[j]; in Init()
|
D | broadcast_grad_gpu_kernel.h | 74 auto shape1 = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); in Init() local 77 … is_null_input_ = CHECK_NULL_INPUT(shape1) || CHECK_NULL_INPUT(shape2) || CHECK_NULL_INPUT(shape3); in Init() 83 need_broadcast_ = AnfAlgo::IsTensorBroadcast(shape1, shape2); in Init() 84 if (need_broadcast_ && shape1.size() > kMaxShapeSize) { in Init() 94 int x1_offset = shape3.size() - shape1.size(); in Init() 95 for (size_t i = 0; i < shape1.size(); i++) { in Init() 98 x1_shape_[i + x1_offset] = shape1[i]; in Init() 104 input1_num_ *= shape1[i]; in Init()
|
/third_party/mindspore/tests/ut/cpp/ops/ |
D | test_ops_layer_norm_x_backprop_v2.cc | 58 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 59 EXPECT_EQ(shape1.size(), 3); in TEST_F() 60 EXPECT_EQ(shape1[0], 1); in TEST_F() 61 EXPECT_EQ(shape1[1], 128); in TEST_F() 62 EXPECT_EQ(shape1[2], 1024); in TEST_F()
|
D | test_ops_detection_post_process.cc | 50 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 51 EXPECT_EQ(shape1.size(), 3); in TEST_F() 52 EXPECT_EQ(shape1[0], 1); in TEST_F() 53 EXPECT_EQ(shape1[1], 9); in TEST_F() 54 EXPECT_EQ(shape1[2], 4); in TEST_F()
|
D | test_ops_merge.cc | 53 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 54 EXPECT_EQ(shape1.size(), 2); in TEST_F() 55 EXPECT_EQ(shape1[0], 2); in TEST_F() 56 EXPECT_EQ(shape1[1], 4); in TEST_F()
|
D | test_ops_batch_norm.cc | 52 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 53 EXPECT_EQ(shape1.size(), 2); in TEST_F() 54 EXPECT_EQ(shape1[0], 2); in TEST_F() 55 EXPECT_EQ(shape1[1], 2); in TEST_F()
|
D | test_ops_unstack.cc | 51 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 52 EXPECT_EQ(shape1.size(), 1); in TEST_F() 53 EXPECT_EQ(shape1[0], 4); in TEST_F()
|
D | test_ops_unpack.cc | 51 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 52 EXPECT_EQ(shape1.size(), 1); in TEST_F() 53 EXPECT_EQ(shape1[0], 4); in TEST_F()
|
D | test_ops_custom_predict.cc | 52 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 53 EXPECT_EQ(shape1.size(), 1); in TEST_F() 54 EXPECT_EQ(shape1[0], 5); in TEST_F()
|
D | test_ops_layer_norm_beta_gamma_backprop_v2.cc | 55 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 56 EXPECT_EQ(shape1.size(), 1); in TEST_F() 57 EXPECT_EQ(shape1[0], 1024); in TEST_F()
|
D | test_ops_topk.cc | 64 auto shape1 = shape_vec[0]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 65 EXPECT_EQ(shape1.size(), 1); in TEST_F() 66 EXPECT_EQ(shape1[0], 3); in TEST_F()
|
D | test_ops_batch_norm_grad.cc | 59 auto shape1 = shape_vec[1]->cast<abstract::ShapePtr>()->shape(); in TEST_F() local 60 EXPECT_EQ(shape1.size(), 1); in TEST_F() 61 EXPECT_EQ(shape1[0], 1); in TEST_F()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/ |
D | arithmetic_self_int8_tests.cc | 34 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 51 input_tensor1->set_shape(shape1); in TEST_F() 97 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 114 input_tensor1->set_shape(shape1); in TEST_F() 160 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 177 input_tensor1->set_shape(shape1); in TEST_F() 223 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 240 input_tensor1->set_shape(shape1); in TEST_F() 286 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 303 input_tensor1->set_shape(shape1); in TEST_F() [all …]
|
D | crop_int8_tests.cc | 35 std::vector<int> shape1 = {8}; in TEST_F() local 52 input_tensor1->set_shape(shape1); in TEST_F() 102 std::vector<int> shape1 = {2, 8}; in TEST_F() local 119 input_tensor1->set_shape(shape1); in TEST_F() 169 std::vector<int> shape1 = {2, 2, 2}; in TEST_F() local 186 input_tensor1->set_shape(shape1); in TEST_F() 237 std::vector<int> shape1 = {2, 8, 2}; in TEST_F() local 254 input_tensor1->set_shape(shape1); in TEST_F() 304 std::vector<int> shape1 = {2, 2, 2, 2}; in TEST_F() local 321 input_tensor1->set_shape(shape1); in TEST_F() [all …]
|
D | mul_int8_tests.cc | 35 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 55 input_tensor1->set_shape(shape1); in TEST_F() 109 std::vector<int> shape1 = {2, 3, 3}; in TEST_F() local 129 input_tensor1->set_shape(shape1); in TEST_F() 183 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 203 input_tensor1->set_shape(shape1); in TEST_F() 257 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 277 input_tensor1->set_shape(shape1); in TEST_F() 331 std::vector<int> shape1 = {2, 2, 3}; in TEST_F() local 351 input_tensor1->set_shape(shape1); in TEST_F()
|
D | concat_int8_tests.cc | 35 std::vector<int> shape1 = {3, 2}; in TEST_F() local 55 input_tensor1->set_shape(shape1); in TEST_F() 110 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 130 input_tensor1->set_shape(shape1); in TEST_F() 186 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 206 input_tensor1->set_shape(shape1); in TEST_F()
|
D | reshape_int8_tests.cc | 35 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 51 input_tensor1->set_shape(shape1); in TEST_F() 98 std::vector<int> shape1 = {2, 3, 2}; in TEST_F() local 114 input_tensor1->set_shape(shape1); in TEST_F()
|
/third_party/mindspore/mindspore/lite/src/delegate/tensorrt/ |
D | tensorrt_utils.h | 88 bool SameDims(const std::vector<T1> &shape1, const std::vector<T2> &shape2) { in SameDims() argument 89 if (shape1.size() != shape2.size()) { in SameDims() 92 for (size_t i = 0; i < shape1.size(); i++) { in SameDims() 93 if (std::abs(shape1[i] - shape2[i]) > 1e-6) { in SameDims()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32/ |
D | sparse_to_dense_fp32_tests.cc | 35 std::vector<int> shape1 = {6, 2}; in TEST_F() local 46 input_tensor1->set_shape(shape1); in TEST_F() 122 std::vector<int> shape1 = {6, 2}; in TEST_F() local 133 input_tensor1->set_shape(shape1); in TEST_F() 209 std::vector<int> shape1 = {3}; in TEST_F() local 220 input_tensor1->set_shape(shape1); in TEST_F() 294 std::vector<int> shape1 = {1}; in TEST_F() local 305 input_tensor1->set_shape(shape1); in TEST_F() 379 std::vector<int> shape1 = {6, 2}; in TEST_F() local 390 input_tensor1->set_shape(shape1); in TEST_F()
|
/third_party/mindspore/tests/st/ops/ascend/ |
D | test_dynamic_broadcast_gradient_args.py | 36 shape1 = (2, 7) 38 r0, r1 = net(shape0, shape1)
|
/third_party/mindspore/tests/st/ops/graph_kernel/ |
D | test_layernorm_stitch.py | 72 def test_layernorm(shape1, shape2, dtype): argument 74 x = Tensor(np.random.normal(0, 1, shape1).astype(dtype)) 75 y = Tensor(np.random.normal(0, 1, shape1).astype(dtype))
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/model/ |
D | op_node.cc | 379 auto shape1 = inputs[1]->shape; in InferShape() local 381 check_nd(shape1, 4); in InferShape() 390 auto out_channel = shape1[0]; in InferShape() 465 std::vector<int64_t> shape1 = inputs[1]->shape; in InferShape() local 466 if (shape0.size() != 2 || shape1.size() != 2) { in InferShape() 467 …) << "MatMul's input's dimension must be 2, but got " << shape0.size() << " and " << shape1.size(); in InferShape() 475 int64_t k2 = transpose_b ? shape1[1] : shape1[0]; in InferShape() 476 int64_t n = transpose_b ? shape1[0] : shape1[1]; in InferShape()
|