/third_party/mindspore/tests/ut/python/pipeline/parse/ |
D | test_graph_return_const_param.py | 53 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)
|
D | test_ms_function_pass_non_tensor_inputs.py | 40 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)
|
D | test_outermost_net_pass_non_tensor_inputs.py | 31 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/ |
D | test_outermost_non_tensor_input.py | 31 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/ |
D | test_ops_argmax.cc | 37 …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()
|
D | test_ops_prelu.cc | 36 …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()
|
D | test_ops_reshape.cc | 36 …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()
|
D | test_ops_mfcc.cc | 37 …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()
|
D | test_ops_unsqueeze.cc | 79 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()
|
D | test_ops_gather.cc | 37 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()
|
D | test_ops_topk.cc | 39 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()
|
D | test_ops_fftimag.cc | 35 …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()
|
D | test_ops_sin.cc | 35 …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()
|
D | test_ops_flatten.cc | 35 …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()
|
D | test_ops_sqrt.cc | 35 …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()
|
D | test_ops_log.cc | 35 …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()
|
D | test_ops_neg.cc | 36 …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()
|
D | test_ops_cos.cc | 37 …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()
|
D | test_ops_depthtospace.cc | 37 …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()
|
D | test_ops_elu.cc | 38 …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()
|
D | test_ops_fftreal.cc | 36 …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()
|
D | test_ops_exp.cc | 36 …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()
|
D | test_ops_leakyrelu.cc | 36 …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()
|
D | test_ops_floor.cc | 37 …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()
|
D | test_ops_l2normalize.cc | 37 …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()
|