Home
last modified time | relevance | path

Searched refs:reshape (Results 1 – 25 of 403) sorted by relevance

12345678910>>...17

/third_party/mindspore/tests/ut/cpp/parallel/ops_info/
Dreshape_test.cc31 ReshapeInfoPtr reshape; variable
66 reshape = std::make_shared<ReshapeInfo>("reshape_info", inputs_shape, outputs_shape, attr); in SetUp()
67 reshape->set_input_value(val); in SetUp()
74 reshape->Init(strategy); in TEST_F()
75 Shape dev_matrix_shape = reshape->dev_matrix_shape(); in TEST_F()
85 reshape->Init(strategy); in TEST_F()
86 Shape dev_matrix_shape = reshape->dev_matrix_shape(); in TEST_F()
96 reshape->Init(strategy); in TEST_F()
97 std::vector<TensorInfo> inputs = reshape->inputs_tensor_info(); in TEST_F()
98 std::vector<TensorInfo> outputs = reshape->outputs_tensor_info(); in TEST_F()
[all …]
/third_party/mindspore/tests/st/ops/gpu/
Dtest_fake_quant_perlayer.py52 x = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]).reshape(2, 3).astype(np.float32)
53 min_val = np.array([0]).reshape(1).astype(np.float32)
54 max_val = np.array([0]).reshape(1).astype(np.float32)
74 x = np.array([-10.1, -10.0, -9.9, -9.75, 53.75, 53.8]).reshape(2, 3).astype(np.float32)
75 min_val = np.array([-10.0]).reshape(1).astype(np.float32)
76 max_val = np.array([53.75]).reshape(1).astype(np.float32)
94 x = np.array([-10.1, -10.0, -9.90, -9.75, 53.5, 53.6]).reshape(2, 3).astype(np.float32)
95 min_val = np.array([-10.0]).reshape(1).astype(np.float32)
96 max_val = np.array([53.5]).reshape(1).astype(np.float32)
114 x = np.array([-0.1, 0.0, 0.1, 0.25, 63.75, 63.8]).reshape(2, 3).astype(np.float32)
[all …]
Dtest_lstm_op.py82 … -6.1343e-01, -5.8236e-02, -3.7682e-01, 4.8338e-01, -2.1551e-01]]).astype(np.float32).reshape(
92 [0.1831, 0.0850]]).astype(np.float32).reshape([1, -1])
94 …y([-0.2862, 0.0034, 0.2059, -0.6544, 0.3244, -0.2472, 0.0852, -0.3050]).astype(np.float32).reshape(
97 np.float32).reshape([1, -1])
99 w_np = np.concatenate((wih, whh, bih, bhh), axis=1).reshape([-1, 1, 1])
207 np.float32).reshape([1, -1])
216 [0.1152, -0.3124]]).astype(np.float32).reshape([1, -1])
219 np.float32).reshape([1, -1])
221 np.float32).reshape([1, -1])
232 0.4230]]).astype(np.float32).reshape([1, -1])
[all …]
Dtest_fake_quant_perchannel.py151 ).reshape(2, 3).astype(np.float32)
153 min_val = np.array([-0.1, -0.1, -0.1]).reshape(3).astype(np.float32)
154 max_val = np.array([63.65, 63.65, 63.65]).reshape(3).astype(np.float32)
173 ).reshape(2, 3).astype(np.float32)
175 min_val = np.array([-0.1, -0.1, -0.1]).reshape(3).astype(np.float32)
176 max_val = np.array([63.4, 63.4, 63.4]).reshape(3).astype(np.float32)
195 ).reshape(2, 3).astype(np.float32)
198 min_val = np.array([-0.125, -0.125, -0.125]).reshape(3).astype(np.float32)
199 max_val = np.array([63.625, 63.625, 63.625]).reshape(3).astype(np.float32)
218 ).reshape(2, 3).astype(np.float32)
[all …]
Dtest_cast_op.py60 x0 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.float32))
62 x1 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.float16))
78 x0 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.int32))
80 x1 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.bool))
95 x0 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.float16))
97 x1 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.float16))
112 x0 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.int64))
114 x1 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.float32))
129 x0 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.int32))
131 x1 = Tensor(np.arange(24).reshape((4, 3, 2)).astype(np.int32))
[all …]
Dtest_addn_op.py41 x = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float32)
42 y = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float32)
43 z = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float32)
64 x = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
65 y = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
66 z = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
81 x = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
82 y = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
83 z = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.float64)
103 x = np.arange(1 * 3 * 3 * 4).reshape(1, 3, 3, 4).astype(np.int64)
[all …]
Dtest_batch_matmul.py39 input_x = Tensor(np.arange(2 * 4 * 1 * 3).reshape(2, 4, 1, 3), mstype.float32)
40 input_y = Tensor(np.arange(2 * 4 * 3 * 4).reshape(2, 4, 3, 4), mstype.float32)
61 input_x = Tensor(np.arange(2 * 4 * 1 * 3).reshape(2, 4, 1, 3), mstype.float64)
62 input_y = Tensor(np.arange(2 * 4 * 3 * 4).reshape(2, 4, 3, 4), mstype.float64)
83 input_x = Tensor(np.arange(2 * 4 * 3 * 1).reshape(2, 4, 3, 1), mstype.float32)
84 input_y = Tensor(np.arange(2 * 4 * 3 * 4).reshape(2, 4, 3, 4), mstype.float32)
105 input_x = Tensor(np.arange(2 * 4 * 1 * 3).reshape(2, 4, 1, 3), mstype.float32)
106 input_y = Tensor(np.arange(2 * 4 * 4 * 3).reshape(2, 4, 4, 3), mstype.float32)
127 input_x = Tensor(np.arange(2 * 4 * 3 * 1).reshape(2, 4, 3, 1), mstype.float32)
128 input_y = Tensor(np.arange(2 * 4 * 4 * 3).reshape(2, 4, 4, 3), mstype.float32)
[all …]
Dtest_sparse_apply_proximal_adagrad_op.py48 var = Tensor(np.arange(9).reshape(3, 3).astype(np.float32))
49 accum = Tensor(np.zeros(9).reshape(3, 3).astype(np.float32))
53 grad = Tensor(np.ones(9).reshape(3, 3).astype(np.float32) * 8)
69 var = Tensor(np.arange(9).reshape(3, 3).astype(np.float32))
70 accum = Tensor(np.zeros(9).reshape(3, 3).astype(np.float32))
74 grad = Tensor(np.ones(9).reshape(3, 3).astype(np.float32) * 8)
91 var = Tensor(np.arange(9).reshape(3, 3).astype(np.float32))
92 accum = Tensor(np.zeros(9).reshape(3, 3).astype(np.float32))
96 grad = Tensor(np.ones(9).reshape(3, 3).astype(np.float32) * 8)
112 var = Tensor(np.arange(9).reshape(3, 3).astype(np.float32))
[all …]
Dtest_extract_image_patches_op.py40 input_tensor = Tensor(np.arange(360).reshape(3, 2, 6, 10).astype(np.float32))
48 … 261., 266., 321., 326., 262., 267., 322., 327., 263., 268., 323., 328.]).reshape((3, 16, 1, 2))
53 input_tensor = Tensor(np.arange(360).reshape(3, 2, 6, 10).astype(np.float32))
61 … 261., 266., 321., 326., 262., 267., 322., 327., 263., 268., 323., 328.]).reshape((3, 16, 1, 2))
71 input_tensor = Tensor(np.arange(6).reshape(1, 1, 2, 3).astype(np.float32))
74 0., 0., 0., 0., 0., 0., 0.]).reshape((1, 10, 1, 2))
79 input_tensor = Tensor(np.arange(6).reshape(1, 1, 2, 3).astype(np.float32))
82 0., 0., 0., 0., 0., 0.]).reshape((1, 10, 1, 2))
Dtest_fake_quant_perlayer_grad.py42 min_val = np.array([-0.125]).reshape(1).astype(np.float32)
43 max_val = np.array([63.625]).reshape(1).astype(np.float32)
63 min_val = np.array([-0.125]).reshape(1).astype(np.float32)
64 max_val = np.array([63.375]).reshape(1).astype(np.float32)
84 min_val = np.array([-0.4]).reshape(1).astype(np.float32)
85 max_val = np.array([7.1]).reshape(1).astype(np.float32)
105 min_val = np.array([-0.4]).reshape(1).astype(np.float32)
106 max_val = np.array([6.6]).reshape(1).astype(np.float32)
126 min_val = np.array([0.0]).reshape(1).astype(np.float32)
127 max_val = np.array([0.0]).reshape(1).astype(np.float32)
[all …]
Dtest_batchnorm_fold2_op.py72 expect = (x + beta.reshape(-1, 1,
73 1) - (gamma * running_mean / running_std).reshape(-1, 1,
75 …x * (running_std / batch_std).reshape(-1, 1, 1) + (beta - gamma * batch_mean / batch_std).reshape(…
85 expect = (x + beta.reshape(-1, 1,
86 1) - (gamma * running_mean / running_std).reshape(-1, 1,
88 …x * (batch_std / running_std).reshape(-1, 1, 1) + (beta - gamma * batch_mean / batch_std).reshape(…
Dtest_apply_gradient_descent_op.py40 var = Tensor(np.arange(10).reshape(2, 5).astype(np.float32) / 10)
43 delta = Tensor(np.arange(34, 44).reshape(2, 5).astype(np.float32))
51 var = Tensor(np.arange(10).reshape(2, 5).astype(np.float32) / 10)
54 delta = Tensor(np.arange(34, 44).reshape(2, 5).astype(np.float32))
67 var = Tensor(np.arange(10).reshape(2, 5).astype(np.float16) / 10)
70 delta = Tensor(np.arange(34, 44).reshape(2, 5).astype(np.float16))
78 var = Tensor(np.arange(10).reshape(2, 5).astype(np.float16) / 10)
81 delta = Tensor(np.arange(34, 44).reshape(2, 5).astype(np.float16))
/third_party/mindspore/tests/st/ops/ascend/test_aicpu_ops/
Dtest_reshape.py28 self.reshape = P.Reshape()
31 return self.reshape(tensor, (4, 4))
39 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
47 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
55 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
63 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
71 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
79 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
87 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
95 assert np.all(output.asnumpy() == np.reshape(x, (4, 4)))
[all …]
/third_party/mindspore/tests/vm_impl/
Dvm_me.py40 col = col.reshape(-1, pool_h * pool_w)
43 out = out.reshape((num, out_h, out_w, channel)).transpose(0, 3, 1, 2)
113 x = x.reshape(batch_num, -1)
118 return out.reshape(*input_shape), np.array(scale), np.array(shift), running_mean, running_var
126 x = x.reshape(batch_num, -1)
147 dy = dy.reshape(batch_size, -1)
151 dx = dx.reshape(*input_shape)
189 col = col.reshape(batch_num, out_h, out_w, channel, filter_h, filter_w) \
276 col_w = np.reshape(weight, (filter_num, -1)).T
278 out = out.reshape((batch_num, out_h, out_w, -1)).transpose(0, 3, 1, 2)
[all …]
/third_party/mindspore/tests/st/ops/cpu/
Dtest_batch_matmul.py45 input_x = Tensor(np.arange(2 * 4 * 1 * 3).reshape((2, 4, 1, 3)), mstype.float32)
46 input_y = Tensor(np.arange(2 * 4 * 3 * 4).reshape((2, 4, 3, 4)), mstype.float32)
66 input_x = Tensor(np.arange(2 * 3 * 2 * 3).reshape((2, 3, 2, 3)), mstype.float32)
67 input_y = Tensor(np.arange(2 * 3 * 3 * 4).reshape((2, 3, 3, 4)), mstype.float32)
91 input_x = Tensor(np.arange(2 * 3 * 3 * 2).reshape((2, 3, 3, 2)), mstype.float32)
92 input_y = Tensor(np.arange(2 * 3 * 3 * 4).reshape((2, 3, 3, 4)), mstype.float32)
116 input_x = Tensor(np.arange(2 * 3 * 2 * 3).reshape((2, 3, 2, 3)), mstype.float32)
117 input_y = Tensor(np.arange(2 * 3 * 4 * 3).reshape((2, 3, 4, 3)), mstype.float32)
141 input_x = Tensor(np.arange(2 * 3 * 3 * 2).reshape((2, 3, 3, 2)), mstype.float16)
142 input_y = Tensor(np.arange(2 * 3 * 4 * 3).reshape((2, 3, 4, 3)), mstype.float16)
Dtest_matmul.py43 input_x = Tensor(np.arange(1 * 3).reshape((1, 3)), mstype.float32)
44 input_y = Tensor(np.arange(3 * 5).reshape((3, 5)), mstype.float32)
57 input_x = Tensor(np.arange(4 * 3).reshape((4, 3)), mstype.float32)
58 input_y = Tensor(np.arange(3 * 5).reshape((3, 5)), mstype.float32)
74 input_x = Tensor(np.arange(3 * 2).reshape((3, 2)), mstype.float32)
75 input_y = Tensor(np.arange(3 * 4).reshape((3, 4)), mstype.float32)
89 input_x = Tensor(np.arange(2 * 3).reshape((2, 3)), mstype.float32)
90 input_y = Tensor(np.arange(5 * 3).reshape((5, 3)), mstype.float32)
104 input_x = Tensor(np.arange(3 * 5).reshape((3, 5)), mstype.float16)
105 input_y = Tensor(np.arange(4 * 3).reshape((4, 3)), mstype.float16)
Dtest_transpose_op.py34 …self.x_2D = Parameter(initializer(Tensor(np.arange(5 * 6).reshape(5, 6).astype(np.float32)), [5, 6…
38 …self.x_3D = Parameter(initializer(Tensor(np.arange(2 * 2 * 4).reshape(2, 2, 4).astype(np.float32))…
43 initializer(Tensor(np.arange(2 * 3 * 4 * 5).reshape(2,
49 … initializer(Tensor(np.arange(1 * 2 * 3 * 4 * 5).reshape(1, 2, 3, 4, 5).astype(np.float32)),
156 …self.x_2D = Parameter(initializer(Tensor(np.arange(5 * 6).reshape(5, 6).astype(np.int64)), [5, 6]),
160 …self.x_3D = Parameter(initializer(Tensor(np.arange(2 * 2 * 4).reshape(2, 2, 4).astype(np.int64)), …
165 initializer(Tensor(np.arange(2 * 3 * 4 * 5).reshape(2,
171 … initializer(Tensor(np.arange(1 * 2 * 3 * 4 * 5).reshape(1, 2, 3, 4, 5).astype(np.int64)),
278 …self.x_2D = Parameter(initializer(Tensor(np.arange(5 * 6).reshape(5, 6).astype(np.uint8)), [5, 6]),
282 …self.x_3D = Parameter(initializer(Tensor(np.arange(2 * 2 * 4).reshape(2, 2, 4).astype(np.uint8)), …
[all …]
/third_party/mindspore/tests/ut/python/parallel/
Dtest_reshape_unexpand.py54 self.reshape = P.Reshape()
59 weight = self.reshape(self.mul_weight, (1, 128, 96))
77 self.reshape = P.Reshape()
82 x = self.reshape(self.mul_weight, (1, 128, 96))
100 self.reshape = P.Reshape()
105 x = self.reshape(self.mul_weight, (1, 128, 96))
123 self.reshape = P.Reshape()
129 x = self.reshape(x, (3, 4))
147 self.reshape = P.Reshape()
153 x = self.reshape(x, (3, 2, 2))
[all …]
Dtest_auto_parallel_reshape.py55 self.reshape = P.Reshape()
60 out = self.reshape(x, (64, 28))
78 self.reshape = P.Reshape()
83 out = self.reshape(x, (64, 28))
84 out = self.reshape(out, (64, 28, 1))
103 self.reshape = P.Reshape()
109 out = self.reshape(out, (64, 28))
129 self.reshape = P.Reshape()
136 out = self.reshape(out, (64, 28))
138 out = self.reshape(out, (128, 32))
[all …]
/third_party/mindspore/tests/st/fl/cross_silo_faster_rcnn/src/FasterRcnn/
Danchor_generator.py43 ws = (w * w_ratios[:, None] * self.scales[None, :]).reshape(-1)
44 hs = (h * h_ratios[:, None] * self.scales[None, :]).reshape(-1)
46 ws = (w * self.scales[:, None] * w_ratios[None, :]).reshape(-1)
47 hs = (h * self.scales[:, None] * h_ratios[None, :]).reshape(-1)
60 xx = np.repeat(x.reshape(1, len(x)), len(y), axis=0).reshape(-1)
82 all_anchors = all_anchors.reshape(-1, 4)
/third_party/mindspore/tests/ut/python/dataset/
Dtest_rgb_hsv.py41 rgb_np = rgb_flat.reshape((8, 8, 3))
47 hsv_base = hsv_base.reshape((8, 8, 3))
52 hsv_flat = hsv_base.reshape(64, 3)
58 rgb_base = rgb_base.reshape((8, 8, 3))
66 rgb_np = rgb_flat.reshape((4, 2, 8, 3))
72 hsv_base = hsv_base.reshape((4, 2, 8, 3))
77 hsv_flat = hsv_base.reshape((64, 3))
83 rgb_base = rgb_base.reshape((4, 2, 8, 3))
91 rgb_np = rgb_flat.reshape((3, 8, 8))
96 hsv_base = hsv_base.reshape((3, 8, 8))
[all …]
Dtest_magphase.py52 input_number = np.array([41, 67, 34, 0, 69, 24, 78, 58]).reshape((2, 2, 2)).astype("double")
53 mag = np.array([78.54934755, 34., 73.05477397, 97.20082304]).reshape((2, 2)).astype("double")
54 phase = np.array([1.02164342, 0, 0.33473684, 0.63938591]).reshape((2, 2)).astype("double")
70 input_number = np.array([1, 2, 3, 4]).reshape(4,).astype("double")
77 input_number = np.array([1, 2, 3, 4]).reshape(1, 4).astype("double")
84 input_number = np.array(['test', 'test']).reshape(1, 2)
91 input_number = np.array([1, 2, 3, 4]).reshape(2, 2).astype("double")
/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_partial.py38 x = Tensor(np.arange(3).reshape((3,)).astype(np.float32))
39 y = Tensor(np.arange(3 * 4).reshape((3, 4)).astype(np.float32))
40 z = Tensor(np.arange(3 * 4 * 5).reshape((3, 4, 5)).astype(np.float32))
57 x = Tensor(np.arange(3).reshape((3,)).astype(np.float32))
58 y = Tensor(np.arange(3 * 4).reshape((3, 4)).astype(np.float32))
59 z = Tensor(np.arange(3 * 4 * 5).reshape((3, 4, 5)).astype(np.float32))
76 x = Tensor(np.arange(3).reshape((3,)).astype(np.float32))
77 y = Tensor(np.arange(3 * 4).reshape((3, 4)).astype(np.float32))
78 z = Tensor(np.arange(3 * 4 * 5).reshape((3, 4, 5)).astype(np.float32))
96 x = Tensor(np.arange(3).reshape((3,)).astype(np.float32))
[all …]
/third_party/mindspore/mindspore/lite/tools/converter/parser/onnx/
Donnx_pad_adjust.cc72 auto reshape = func_graph->NewCNode(op_inputs); in NewReshapeOpNode() local
73 MS_CHECK_TRUE_MSG(reshape != nullptr, nullptr, "create cnode return nullptr"); in NewReshapeOpNode()
74 reshape->set_fullname_with_scope(input_node->fullname_with_scope() + "_reshape"); in NewReshapeOpNode()
75 return reshape; in NewReshapeOpNode()
94 auto reshape = func_graph->NewCNode(op_inputs); in NewTransposeOpNode() local
95 MS_CHECK_TRUE_MSG(reshape != nullptr, nullptr, "create cnode return nullptr"); in NewTransposeOpNode()
96 reshape->set_fullname_with_scope(input_node->fullname_with_scope() + "_transpose"); in NewTransposeOpNode()
97 return reshape; in NewTransposeOpNode()
/third_party/boost/libs/multi_array/test/
Dreshape.cpp47 A.reshape(new_dims); in main()
48 B.reshape(new_dims); in main()
49 C.reshape(new_dims); in main()
75 A.reshape(new_dims); in main()
76 B.reshape(new_dims); in main()
77 C.reshape(new_dims); in main()

12345678910>>...17