Home
last modified time | relevance | path

Searched refs:tensor_x (Results 1 – 25 of 40) sorted by relevance

12

/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_graph_return_const_param.py53 tensor_x = Tensor(np.zeros(2), dtype=mstype.int32)
55 out = choose(tensor_x, tensor_y)
56 assert np.allclose(tensor_x.asnumpy(), out.asnumpy())
61 tensor_x = Tensor(1, dtype=mstype.int32)
63 out = choose(tensor_x, tensor_y)
68 tensor_x = Tensor(np.zeros(2), dtype=mstype.int32)
70 choose = ChooseOneConst(0, tensor_x, tensor_y)
72 assert np.allclose(tensor_x.asnumpy(), out.asnumpy())
76 tensor_x = Tensor(np.zeros(2), dtype=mstype.int32)
78 choose = ChooseOneConst(1, tensor_x, tensor_y)
Dtest_ms_function_pass_non_tensor_inputs.py40 tensor_x = Tensor(np.ones((2, 3, 4), np.float32))
45 compute(tensor_x, tensor_y, p, q, w)
49 def tensor_reduce(tensor_x, axis, tensor_y): argument
51 ret = reduce_sum(tensor_x, axis) + tensor_y
56 tensor_x = Tensor(np.ones((2, 3, 4, 5), np.float32))
59 tensor_reduce(tensor_x, axis, tensor_y)
Dtest_outermost_net_pass_non_tensor_inputs.py31 def construct(self, tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag): argument
33 return tensor_x - tuple_a[2] + list_b[1][1]["x"] - tensor_y + scalar - dict_c["x"]
34 return tensor_x + tuple_a[2] - list_b[1][1]["y"] + tensor_y - scalar + dict_c["y"]
44 def construct(self, tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag): argument
45 … return self.grad_all(self.forward_net)(tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag)
55 def construct(self, tuple_a, tensor_x, list_b, tensor_y, tensor_z, dict_c): argument
56 … return self.grad_all(self.forward_net)(tuple_a, tensor_x, list_b, tensor_y, tensor_z, dict_c)
87 def construct(self, tensor_x, tuple_a, list_b, tensor_y, tensor_z, dict_c): argument
88 return tensor_x + tuple_a[2] - list_b[1][1]["y"] + tensor_y - tensor_z + dict_c["y"]
/third_party/mindspore/tests/ut/python/pynative_mode/
Dtest_outermost_non_tensor_input.py31 def construct(self, tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag): argument
33 return tensor_x - tuple_a[2] + list_b[1][1]["x"] - tensor_y + scalar - dict_c["x"]
34 return tensor_x + tuple_a[2] - list_b[1][1]["y"] + tensor_y - scalar + dict_c["y"]
44 def construct(self, tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag): argument
45 … return self.grad_all(self.forward_net)(tuple_a, tensor_x, list_b, tensor_y, scalar, dict_c, flag)
55 def construct(self, tuple_a, tensor_x, list_b, tensor_y, tensor_z, dict_c): argument
56 … return self.grad_all(self.forward_net)(tuple_a, tensor_x, list_b, tensor_y, tensor_z, dict_c)
87 def construct(self, tensor_x, tuple_a, list_b, tensor_y, tensor_z, dict_c): argument
88 return tensor_x + tuple_a[0] - list_b[1][1]["y"] + tensor_y - tensor_z + dict_c["y"]
/third_party/mindspore/tests/ut/cpp/ops/
Dtest_ops_argmax.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = argmax->Infer({tensor_x->ToAbstract()}); in TEST_F()
65 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat16, std::vector<int64_t>{2,… in TEST_F() local
66 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
67 auto abstract = argmax->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_prelu.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
40 auto abstract = prelu->Infer({tensor_x->ToAbstract(), tensor_w->ToAbstract()}); in TEST_F()
65 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat16, std::vector<int64_t>{5,… in TEST_F() local
67 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
69 auto abstract = prelu->Infer({tensor_x->ToAbstract(), tensor_w->ToAbstract()}); in TEST_F()
Dtest_ops_reshape.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = reshape->Infer({tensor_x->ToAbstract(), input_shape->ToAbstract()}); in TEST_F()
64 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat16, std::vector<int64_t>{2,… in TEST_F() local
66 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
67 auto abstract = reshape->Infer({tensor_x->ToAbstract(), input_shape->ToAbstract()}); in TEST_F()
Dtest_ops_mfcc.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
39 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
40 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
41 auto mfcc_abstract = mfcc->Infer({tensor_x->ToAbstract(), tensor_y->ToAbstract()}); in TEST_F()
Dtest_ops_unsqueeze.cc79 auto tensor_x = std::make_shared<tensor::Tensor>(kNumberTypeFloat32, std::vector<int64_t>{1, 3}); in TEST_F() local
80 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
81 auto tensor_x_data = reinterpret_cast<int *>(tensor_x->data_c()); in TEST_F()
88 auto abstract = unsqueeze->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_gather.cc37 auto tensor_x = std::make_shared<tensor::Tensor>(kNumberTypeInt32, std::vector<int64_t>{2, 2}); in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto tensor_x_data = reinterpret_cast<int *>(tensor_x->data_c()); in TEST_F()
61 auto abstract = gather->Infer({tensor_x->ToAbstract(), dim->ToAbstract(), index->ToAbstract()}); in TEST_F()
Dtest_ops_topk.cc39 auto tensor_x = std::make_shared<tensor::Tensor>(kNumberTypeFloat16, std::vector<int64_t>{5}); in TEST_F() local
40 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
41 auto tensor_x_data = reinterpret_cast<int *>(tensor_x->data_c()); in TEST_F()
54 auto abstract = topk->Infer({tensor_x->ToAbstract(), k->ToAbstract()}); in TEST_F()
Dtest_ops_fftimag.cc35 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
36 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
37 auto fftimag_abstract = fftimag->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_sin.cc35 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
36 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
37 auto sin_abstract = sin->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_flatten.cc35 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
36 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
38 auto flatten_abstract = flatten->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_sqrt.cc35 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
36 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
37 auto sqrt_abstract = sqrt->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_log.cc35 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{1,… in TEST_F() local
36 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
37 auto log_abstract = log->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_neg.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
37 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
38 auto abstract = neg->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_cos.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = cos->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_depthtospace.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{3,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = depth_to_space->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_elu.cc38 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
39 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
40 auto abstract = elu->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_fftreal.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
37 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
38 auto abstract = fft_real->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_exp.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat16, std::vector<int64_t>{2,… in TEST_F() local
37 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
38 auto abstract = exp->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_leakyrelu.cc36 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{3,… in TEST_F() local
37 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
38 auto abstract = leakyrelu->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_floor.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = floor->Infer({tensor_x->ToAbstract()}); in TEST_F()
Dtest_ops_l2normalize.cc37 …auto tensor_x = TensorConstructUtils::CreateOnesTensor(kNumberTypeFloat32, std::vector<int64_t>{2,… in TEST_F() local
38 MS_EXCEPTION_IF_NULL(tensor_x); in TEST_F()
39 auto abstract = l2_normalize->Infer({tensor_x->ToAbstract()}); in TEST_F()

12