Home
last modified time | relevance | path

Searched refs:to_tensor (Results 1 – 23 of 23) sorted by relevance

/third_party/mindspore/tests/st/numpy_native/
Dtest_array_ops.py27 rand_bool, match_res, run_multi_test, to_tensor, match_all_arrays
139 mnp_array = to_tensor(onp_array)
170 mnp_array = to_tensor(onp_array)
205 mnp_array = to_tensor(onp_array)
211 mnp_array = to_tensor(onp_array)
246 mnp_array = to_tensor(onp_array)
281 mnp_array = to_tensor(onp_array)
324 mnp_array = to_tensor(onp_array)
349 mnp_array = to_tensor(onp_array)
380 mnp_array = to_tensor(onp_array)
[all …]
Dtest_logic_ops.py24 match_all_arrays, to_tensor
273 assert mnp.isscalar(to_tensor(True)) == onp.isscalar(onp.array(True))
290 … match_all_arrays(mnp.isclose(to_tensor(a), to_tensor(b), atol=1e-3), onp.isclose(a, b, atol=1e-3))
291 match_all_arrays(mnp.isclose(to_tensor(a), to_tensor(b), atol=1e-3, rtol=1e-4),
293 match_all_arrays(mnp.isclose(to_tensor(a), to_tensor(b), atol=1e-2, rtol=1e-6),
298 match_all_arrays(mnp.isclose(to_tensor(a), to_tensor(b)), onp.isclose(a, b))
402 actual = mnp_logical_not(to_tensor(arr))
489 mnp_arr = to_tensor(onp_arr)
Dtest_math_ops.py24 run_single_test, match_res, match_array, match_meta, match_all_arrays, to_tensor
608 a = to_tensor(arr, dtype=mnp.float16)
609 b = to_tensor(arr, dtype=mnp.float32)
610 c = to_tensor(arr, dtype=mnp.int32)
633 a = to_tensor(arr, dtype=mnp.float16)
634 b = to_tensor(arr, dtype=mnp.float32)
635 c = to_tensor(arr, dtype=mnp.uint8)
636 d = to_tensor(arr, dtype=mnp.bool_)
703 mnp_arrs = map(to_tensor, arrs)
845 actual = mnp_logaddexp(to_tensor(x1), to_tensor(x2))
[all …]
Dtest_array_creations.py23 match_all_arrays, run_multi_test, to_tensor
367 expected = mnp.linspace(to_tensor(start), to_tensor(stop), num=20,
374 expected = mnp.linspace(to_tensor(start), to_tensor(stop), num=20,
382 expected = mnp.linspace(to_tensor(start), to_tensor(stop), num=20,
504 actual = mnp.full_like(mnp_proto, to_tensor(fill_value)).asnumpy()
510 actual = mnp.full_like(mnp_proto, to_tensor(fill_value)).asnumpy()
515 actual = mnp.full_like(mnp_proto, to_tensor(fill_value)).asnumpy()
637 mnp_arrs = map(to_tensor, arrs)
730 match_array(mnp.geomspace(to_tensor(start), end, num=4).asnumpy(),
732 match_array(mnp.geomspace(to_tensor(start), end, num=4, endpoint=False).asnumpy(),
[all …]
Dutils.py175 def to_tensor(obj, dtype=None): function
/third_party/mindspore/tests/ut/python/nn/
Dtest_transformer.py200 to_tensor = Tensor(np.ones((2, 20, 15)), dtype.float16)
203 _cell_graph_executor.compile(model, from_tensor, to_tensor, to_tensor, attention_mask)
213 to_tensor = Tensor(np.ones((3, 20, 15)), dtype.float16)
217 _cell_graph_executor.compile(model, from_tensor, to_tensor, to_tensor, attention_mask)
/third_party/mindspore/mindspore/nn/probability/dpn/vae/
Dvae.py66 self.to_tensor = P.ScalarToArray()
103 …mple_z = self.normal((generate_nums, self.latent_size), self.to_tensor(0.0), self.to_tensor(1.0), …
Dcvae.py73 self.to_tensor = P.ScalarToArray()
117 …mple_z = self.normal((generate_nums, self.latent_size), self.to_tensor(0.0), self.to_tensor(1.0), …
/third_party/mindspore/tests/ut/python/dataset/
Dtest_decode.py107 to_tensor = py_vision.ToTensor(output_type=np.int32)
108 dataset1 = dataset1.map(operations=[decode_op, to_tensor], input_columns=["data"])
109 dataset2 = dataset2.map(operations=[decode_op, to_tensor], input_columns=["data"])
/third_party/mindspore/tests/st/fl/cross_silo_faster_rcnn/src/FasterRcnn/
Drpn.py170 weight_conv = initializer('Normal', shape=shp_weight_conv, dtype=self.ms_type).to_tensor()
171 bias_conv = initializer(0, shape=shp_bias_conv, dtype=self.ms_type).to_tensor()
175 weight_cls = initializer('Normal', shape=shp_weight_cls, dtype=self.ms_type).to_tensor()
176 bias_cls = initializer(0, shape=shp_bias_cls, dtype=self.ms_type).to_tensor()
180 weight_reg = initializer('Normal', shape=shp_weight_reg, dtype=self.ms_type).to_tensor()
181 bias_reg = initializer(0, shape=shp_bias_reg, dtype=self.ms_type).to_tensor()
Drcnn.py91 … weights_0 = initializer("XavierUniform", shape=shape_0[::-1], dtype=self.ms_type).to_tensor()
93 … weights_1 = initializer("XavierUniform", shape=shape_1[::-1], dtype=self.ms_type).to_tensor()
98 dtype=self.ms_type).to_tensor()
100 dtype=self.ms_type).to_tensor()
Dfpn_neck.py33 weights = initializer("XavierUniform", shape=shape, dtype=mstype.float32).to_tensor()
/third_party/mindspore/tests/mindspore_test_framework/apps/
Dbert_attention_submodules.py71 def construct(self, from_tensor, to_tensor): argument
73 to_tensor_2d = self.reshape(to_tensor, self.shp_to_2d)
263 def construct(self, to_tensor, attention_scores): argument
264 to_tensor = self.transpose(to_tensor, self.trans_shape_start)
265 to_tensor_2d = self.reshape(to_tensor, self.shp_to_2d)
/third_party/mindspore/tests/st/probability/dpn/
Dtest_gpu_vae_gan.py97 self.to_tensor = ops.ScalarToArray()
101 z_p = self.normal(self.shape(mu), self.to_tensor(0.0), self.to_tensor(1.0), seed=0)
/third_party/mindspore/mindspore/nn/probability/toolbox/
Duncertainty_evaluation.py340 self.to_tensor = P.ScalarToArray()
352 epsilon = self.normal((1, sample_times), self.to_tensor(
353 0.0), self.to_tensor(1.0), 0)
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/common/
Dhelper.h178 bool to_tensor = false);
Dhelper.cc504 …ShapeValueNode(const FuncGraphPtr &func_graph, const std::vector<int64_t> &shape, bool to_tensor) { in CreateShapeValueNode() argument
510 if (to_tensor) { in CreateShapeValueNode()
/third_party/mindspore/tests/st/networks/models/bert/src/
Dbert_model.py494 def construct(self, from_tensor, to_tensor, attention_mask): argument
497 to_tensor_2d = self.reshape(to_tensor, self.shape_to_2d)
/third_party/mindspore/tests/st/fl/albert/src/
Dmodel.py445 def construct(self, from_tensor, to_tensor, attention_mask): argument
449 to_tensor_2d = self.reshape(to_tensor, self.shape_to_2d)
/third_party/mindspore/mindspore/dataset/vision/
Dpy_transforms.py102 return util.to_tensor(img, self.output_type)
Dpy_transforms_util.py131 def to_tensor(img, output_type): function
/third_party/mindspore/mindspore/nn/layer/
Dthor_layer.py585 self.init_tensor = self.init_tensor.to_tensor().asnumpy()
/third_party/mindspore/mindspore/common/
Dtensor.py1272 def to_tensor(self, slice_index=None, shape=None, opt_shard_group=None): member in Tensor