Home
last modified time | relevance | path

Searched refs:shape1 (Results 1 – 25 of 58) sorted by relevance

123

/third_party/mindspore/mindspore/core/abstract/
Dutils.cc55 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/
Dtest_layernorm.py26 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/
Dbroadcast_gpu_kernel.h73 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()
Dbroadcast_complex_gpu_kernel.h61 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()
Dbroadcast_grad_gpu_kernel.h74 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/
Dtest_ops_layer_norm_x_backprop_v2.cc58 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()
Dtest_ops_detection_post_process.cc50 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()
Dtest_ops_merge.cc53 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()
Dtest_ops_batch_norm.cc52 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()
Dtest_ops_unstack.cc51 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()
Dtest_ops_unpack.cc51 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()
Dtest_ops_custom_predict.cc52 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()
Dtest_ops_layer_norm_beta_gamma_backprop_v2.cc55 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()
Dtest_ops_topk.cc64 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()
Dtest_ops_batch_norm_grad.cc59 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/
Darithmetic_self_int8_tests.cc34 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 …]
Dcrop_int8_tests.cc35 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 …]
Dmul_int8_tests.cc35 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()
Dconcat_int8_tests.cc35 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()
Dreshape_int8_tests.cc35 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/
Dtensorrt_utils.h88 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/
Dsparse_to_dense_fp32_tests.cc35 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/
Dtest_dynamic_broadcast_gradient_args.py36 shape1 = (2, 7)
38 r0, r1 = net(shape0, shape1)
/third_party/mindspore/tests/st/ops/graph_kernel/
Dtest_layernorm_stitch.py72 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/
Dop_node.cc379 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()

123