/third_party/mindspore/tests/st/ops/gpu/ |
D | test_range_op.py | 18 import mindspore.common.dtype as mstype namespace 41 ms_out = range_net(Tensor(1000.04, mstype.float32), 42 Tensor(1001.04, mstype.float32), 43 Tensor(0.01, mstype.float32)).asnumpy() 48 ms_out = range_net(Tensor(100, mstype.float32), 49 Tensor(101, mstype.float32), 50 Tensor(0.001, mstype.float32)).asnumpy() 55 ms_out = range_net(Tensor(1, mstype.float32), 56 Tensor(8000, mstype.float32), 57 Tensor(0.01, mstype.float32)).asnumpy() [all …]
|
D | test_unsorted_segment_sum.py | 22 from mindspore.common import dtype as mstype unknown 42 input_x = Tensor([1, 2, 3, 4], mstype.float32) 43 segment_ids = Tensor([0, 0, 1, 2], mstype.int32) 59 [9, 10, 11, 12]], mstype.float32) 60 segment_ids = Tensor([2, 1, 1], mstype.int32) 78 segment_ids = Tensor([2, 1, 1, -1], mstype.int32) 140 input_x = Tensor([1, 2, 3, 4], mstype.float32) 141 segment_ids = Tensor([0, 0, 1, 2], mstype.int32) 148 [9, 10, 11, 12]], mstype.float32) 149 segment_ids = Tensor([2, 1, 1], mstype.int32) [all …]
|
D | test_cast_op.py | 19 import mindspore.common.dtype as mstype namespace 61 t0 = mstype.float16 63 t1 = mstype.float32 79 t0 = mstype.float32 81 t1 = mstype.float32 96 t0 = mstype.int32 98 t1 = mstype.float64 113 t0 = mstype.int32 115 t1 = mstype.int32 130 t0 = mstype.float16 [all …]
|
/third_party/mindspore/tests/st/ops/ascend/ |
D | test_autocast.py | 21 from mindspore import dtype as mstype unknown 67 Tensor([True, False], mstype.bool_) 68 t_uint8 = Tensor(np.ones([2, 1, 2, 2]), mstype.uint8) 69 t_int8 = Tensor(np.ones([2, 1, 2, 2]), mstype.int8) 70 t_int16 = Tensor(np.ones([2, 1, 2, 2]), mstype.int16) 71 t_int32 = Tensor(np.ones([2, 1, 2, 2]), mstype.int32) 72 t_int64 = Tensor(np.ones([2, 1, 2, 2]), mstype.int64) 73 t_fp16 = Tensor(np.ones([2, 1, 2, 2]), mstype.float16) 74 t_fp32 = Tensor(np.ones([2, 1, 2, 2]), mstype.float32) 75 t_fp64 = Tensor(np.ones([2, 1, 2, 2]), mstype.float64) [all …]
|
/third_party/mindspore/tests/ut/python/ops/ |
D | test_tensor_slice.py | 21 from mindspore import dtype as mstype unknown 152 self.const = Tensor(np.ones((5, 4, 7, 8)), mstype.int32) 162 self.const = Tensor(np.ones((3, 4, 5, 8)), mstype.int32) 172 self.const = Tensor(np.ones((5, 3, 4, 5)), mstype.int32) 254 mstype.float32), 268 …m = Parameter(Tensor(np.arange(3 * 4 * 5 * 6 * 7 * 8).reshape((3, 4, 5, 6, 7, 8)), mstype.float32), 282 …m = Parameter(Tensor(np.arange(3 * 4 * 5 * 6 * 7 * 8).reshape((3, 4, 5, 6, 7, 8)), mstype.float16), 313 self.const = Tensor(np.ones((6, 7, 8)), mstype.float32) 314 … self.param = Parameter(Tensor(np.arange(6 * 7 * 8).reshape((6, 7, 8)), mstype.float32), name="x") 326 self.const = Tensor(np.ones((6, 7, 8)), mstype.float32) [all …]
|
/third_party/mindspore/mindspore/ops/operations/ |
D | math_ops.py | 26 from ...common import dtype as mstype unknown 93 def do_infer_dtype(x_dtype, y_dtype, valid_dtype=mstype.number_type, prim_name=None): 96 … complex_types = [mstype.tensor_type(mstype.complex64), mstype.tensor_type(mstype.complex128)] 99 (mstype.complex64, mstype.complex64): mstype.tensor_type(mstype.complex64), 100 (mstype.complex64, mstype.float32): mstype.tensor_type(mstype.complex64), 101 (mstype.float32, mstype.complex64): mstype.tensor_type(mstype.complex64), 102 (mstype.complex128, mstype.complex128): mstype.tensor_type(mstype.complex128), 103 (mstype.complex128, mstype.float64): mstype.tensor_type(mstype.complex128), 104 (mstype.float64, mstype.complex128): mstype.tensor_type(mstype.complex128), 117 return _MathBinaryOp.do_infer_dtype(x_dtype, y_dtype, mstype.number_type, self.name) [all …]
|
D | image_ops.py | 20 from ...common import dtype as mstype unknown 116 … [mstype.int8, mstype.int16, mstype.int32, mstype.int64, mstype.float16, 117 … mstype.float32, mstype.float64, mstype.uint8, mstype.uint16], self.name) 118 validator.check_tensor_dtype_valid("boxes", boxes_dtype, [mstype.float32], self.name) 119 validator.check_tensor_dtype_valid("box_index", box_index_dtype, [mstype.int32], self.name) 132 …validator.check("crop_height dtype", crop_size_dtype[0], "expected", [mstype.int32, mstype.int64],… 134 …validator.check("crop_width dtype", crop_size_dtype[1], "expected", [mstype.int32, mstype.int64], … 145 'dtype': mstype.float32,
|
D | inner_ops.py | 21 from ...common import dtype as mstype unknown 106 def __init__(self, max_length=1, pad=-1, dtype=mstype.int32): 121 validator.check_type_name("n_type", n_type, mstype.int32, self.name) 123 valid_values = (mstype.int8, mstype.int16, mstype.int32, mstype.int64, 124 mstype.uint8, mstype.uint16, mstype.uint32, mstype.uint64) 200 validator.check_type_name("seq_type", seq_type, mstype.int32, self.name) 201 valid_values = (mstype.float16, mstype.float32, mstype.float64) 272 … validator.check_tensors_dtypes_same_and_valid(args, [mstype.float16, mstype.float32], self.name) 277 …validator.check_scalar_or_tensor_types_same(args, [mstype.float16, mstype.float32], self.name, Tru… 330 … validator.check_tensors_dtypes_same_and_valid(args, [mstype.float16, mstype.float32], self.name) [all …]
|
D | sponge_ops.py | 26 from ...common import dtype as mstype unknown 105 … validator.check_tensor_dtype_valid('uint_crd_f', uint_crd_f_dtype, [mstype.uint32], self.name) 106 validator.check_tensor_dtype_valid('scaler_f', scaler_f_type, [mstype.float32], self.name) 107 validator.check_tensor_dtype_valid('atom_a', atom_a_type, [mstype.int32], self.name) 108 validator.check_tensor_dtype_valid('atom_b', atom_b_type, [mstype.int32], self.name) 109 validator.check_tensor_dtype_valid('bond_k', bond_k_type, [mstype.float32], self.name) 110 validator.check_tensor_dtype_valid('bond_r0', bond_r0_type, [mstype.float32], self.name) 191 … validator.check_tensor_dtype_valid('uint_crd_f', uint_crd_f_dtype, [mstype.uint32], self.name) 192 validator.check_tensor_dtype_valid('scaler_f', scaler_f_type, [mstype.float32], self.name) 193 validator.check_tensor_dtype_valid('atom_a', atom_a_type, [mstype.int32], self.name) [all …]
|
D | sponge_update_ops.py | 24 from ...common import dtype as mstype unknown 87 validator.check_tensor_dtype_valid('crd', crd_dtype, [mstype.float32], self.name) 88 … validator.check_tensor_dtype_valid('quarter_cof', quarter_cof_dtype, [mstype.float32], self.name) 89 validator.check_tensor_dtype_valid('test_frc', test_frc_dtype, [mstype.float32], self.name) 90 …validator.check_tensor_dtype_valid('mass_inverse', mass_inverse_dtype, [mstype.float32], self.name) 91 return mstype.uint32 170 validator.check_tensor_dtype_valid('uint_crd', uint_crd_dtype, [mstype.uint32], self.name) 171 validator.check_tensor_dtype_valid('scaler', scaler_dtype, [mstype.float32], self.name) 172 validator.check_tensor_dtype_valid('pair_dr', pair_dr_dtype, [mstype.float32], self.name) 173 …validator.check_tensor_dtype_valid('atom_i_serials', atom_i_serials_dtype, [mstype.int32], self.na… [all …]
|
D | array_ops.py | 36 from ...common import dtype as mstype unknown 70 validator.check_tensor_dtype_valid('indices', indices_dtype, [mstype.int32], self.name) 72 validator.check_tensors_dtypes_same_and_valid(args, mstype.number_type, self.name) 110 validator.check_tensor_dtype_valid('indices', indices_dtype, [mstype.int32], self.name) 112 validator.check_tensors_dtypes_same_and_valid(args, mstype.number_type, self.name) 176 validator.check_subclass("x", x['dtype'], mstype.tensor, self.name) 269 validator.check_subclass('x', x['dtype'], mstype.tensor, self.name) 270 validator.check_subclass('y', y['dtype'], mstype.tensor, self.name) 331 validator.check_subclass("input_x", src_type, [mstype.tensor, mstype.number], self.name) 332 validator.check_subclass("type", dst_type, mstype.number, self.name) [all …]
|
/third_party/mindspore/tests/st/control/inner/ |
D | test_100_if_after_if.py | 19 from mindspore.common import dtype as mstype unknown 28 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 29 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 44 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 45 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 80 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 81 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 100 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 101 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 147 x = Tensor(2, mstype.int32) [all …]
|
D | test_break_continue.py | 17 from mindspore.common import dtype as mstype unknown 44 self.zero = Tensor(np.array(0), mstype.int32) 66 x = Tensor(np.array(1), mstype.int32) 67 y = Tensor(np.array(3), mstype.int32) 70 assert graph_out == Tensor(np.array(3), mstype.int32) 79 x = Tensor(np.array(1), mstype.int32) 80 y = Tensor(np.array(3), mstype.int32) 84 assert graph_grads == (Tensor(np.array(3), mstype.int32), Tensor(np.array(1), mstype.int32)) 91 self.i = Tensor(np.array(0), mstype.int32) 92 self.zero = Tensor(np.array(0), mstype.int32) [all …]
|
D | test_002_single_for.py | 23 from mindspore.common import dtype as mstype unknown 55 x = Tensor([2], mstype.int32) 56 y = Tensor([5], mstype.int32) 57 z = Tensor([4], mstype.int32) 68 assert graph_forward_res == Tensor([125], mstype.int32) 69 …assert graph_backward_res == (Tensor([15], mstype.int32), Tensor([40], mstype.int32), Tensor([5], … 99 x = Tensor([2], mstype.int32) 100 y = Tensor([5], mstype.int32) 101 z = Tensor([4], mstype.int32) 112 assert graph_forward_res == Tensor([195], mstype.int32) [all …]
|
D | test_110_if_after_if_in_if.py | 19 from mindspore.common import dtype as mstype unknown 28 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 29 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 46 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 47 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 68 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 69 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 95 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 96 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 150 x = Tensor(2, mstype.int32) [all …]
|
D | test_212_while_after_if_in_for.py | 17 from mindspore.common import dtype as mstype unknown 31 self.i = Tensor(np.array(0), mstype.int32) 32 self.zero = Tensor(np.array(0), mstype.int32) 33 self.weight = Parameter(Tensor(np.array(0), mstype.int32)) 67 x = Tensor(np.array(3), mstype.int32) 68 y = Tensor(np.array(5), mstype.int32) 74 … assert graph_mode_out == (Tensor(np.array(60), mstype.int32), Tensor(np.array(10), mstype.int32)) 83 x = Tensor(np.array(3), mstype.int32) 84 y = Tensor(np.array(5), mstype.int32) 91 … assert graph_mode_grads == (Tensor(np.array(10), mstype.int32), Tensor(np.array(6), mstype.int32)) [all …]
|
D | test_112_if_after_if_in_for.py | 19 from mindspore.common import dtype as mstype unknown 28 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 29 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 45 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 46 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 66 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 67 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 91 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 92 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 143 x = Tensor(2, mstype.int32) [all …]
|
D | test_010_if_in_if.py | 19 from mindspore.common import dtype as mstype unknown 28 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 29 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 43 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 44 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 65 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 66 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 94 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') 95 self.param_b = Parameter(Tensor(4, mstype.int32), name='b') 117 self.param_a = Parameter(Tensor(5, mstype.int32), name='a') [all …]
|
D | test_121_if_after_while_in_while.py | 18 from mindspore.common import dtype as mstype unknown 33 self.zero = Tensor(np.array(0), mstype.int32) 34 self.i = Tensor(np.array(0), mstype.int32) 35 self.weight = Parameter(Tensor(np.array(0), mstype.int32)) 70 x = Tensor(np.array(1), mstype.int32) 71 y = Tensor(np.array(3), mstype.int32) 77 … assert graph_mode_out == (Tensor(np.array(-11), mstype.int32), Tensor(np.array(9), mstype.int32)) 86 x = Tensor(np.array(1), mstype.int32) 87 y = Tensor(np.array(3), mstype.int32) 94 … assert graph_mode_grads == (Tensor(np.array(9), mstype.int32), Tensor(np.array(3), mstype.int32)) [all …]
|
/third_party/mindspore/mindspore/dataset/core/ |
D | datatypes.py | 22 import mindspore.common.dtype as mstype namespace 39 mstype.bool_: cde.DataType("bool"), 40 mstype.int8: cde.DataType("int8"), 41 mstype.int16: cde.DataType("int16"), 42 mstype.int32: cde.DataType("int32"), 43 mstype.int64: cde.DataType("int64"), 44 mstype.uint8: cde.DataType("uint8"), 45 mstype.uint16: cde.DataType("uint16"), 46 mstype.uint32: cde.DataType("uint32"), 47 mstype.uint64: cde.DataType("uint64"), [all …]
|
/third_party/mindspore/tests/st/auto_monad/ |
D | test_effect_ops.py | 23 from mindspore.common import dtype as mstype unknown 48 x = Tensor(1, dtype=mstype.int32) 49 y = Tensor(2, dtype=mstype.int32) 50 expect = Tensor(3, dtype=mstype.int32) 72 x = Tensor(3, dtype=mstype.int32) 73 y = Tensor(2, dtype=mstype.int32) 74 expect = Tensor(1, dtype=mstype.int32) 96 input_x = Tensor(np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]), mstype.float32) 97 indices = Tensor(np.array([[0, 1], [1, 1]]), mstype.int32) 98 updates = Tensor(np.ones([2, 2, 3]), mstype.float32) [all …]
|
/third_party/mindspore/tests/ut/python/nn/ |
D | test_loss.py | 18 from mindspore.common import dtype as mstype unknown 96 x1 = Tensor([[0.8, 1.4], [0.5, 0.9], [1.2, 0.9]], mstype.float32) 97 x2 = Tensor([[1], [1], [0]], mstype.int32) 104 x1 = Tensor([[0.8, 1.4], [0.5, 0.9], [1.2, 0.9]], mstype.float32) 105 x2 = Tensor([[1], [1], [0]], mstype.int32) 113 x1 = Tensor([[0.8, 1.4], [0.5, 0.9], [1.2, 0.9]], mstype.float32) 114 x2 = Tensor([[1], [1]], mstype.int32) 122 x1 = Tensor([[0.8, 1.4], [0.5, 0.9], [1.2, 0.9]], mstype.float32) 123 x2 = Tensor([[1], [1], [0]], mstype.int32) 131 x1 = Tensor([[0.8, 1.4], [0.5, 0.9], [1.2, 0.9]], mstype.float32) [all …]
|
/third_party/mindspore/tests/st/control/ |
D | test_tensor_in_list.py | 18 from mindspore import dtype as mstype unknown 28 … self.list = [Tensor([1], mstype.int32), Tensor([2], mstype.int32), Tensor([3], mstype.int32)] 44 output = net(Tensor([1], mstype.int32)) 45 expect = Tensor([2], mstype.int32) 48 output = net(Tensor([2], mstype.int32)) 49 expect = Tensor([4], mstype.int32) 52 output = net(Tensor([3], mstype.int32)) 53 expect = Tensor([6], mstype.int32) 56 output = net(Tensor([4], mstype.int32)) 57 expect = Tensor([4], mstype.int32)
|
/third_party/mindspore/tests/ut/python/dataset/ |
D | test_mask_op.py | 21 import mindspore.common.dtype as mstype namespace 26 mstype.bool_: np.bool, 27 mstype.int8: np.int8, 28 mstype.uint8: np.uint8, 29 mstype.int16: np.int16, 30 mstype.uint16: np.uint16, 31 mstype.int32: np.int32, 32 mstype.uint32: np.uint32, 33 mstype.int64: np.int64, 34 mstype.uint64: np.uint64, [all …]
|
/third_party/mindspore/tests/ut/python/parallel/ |
D | test_parallel_transformer.py | 17 import mindspore.common.dtype as mstype namespace 109 encoder_input_value = Tensor(np.ones((2, 20, 64)), mstype.float32) 110 encoder_input_mask = Tensor(np.ones((2, 20, 20)), mstype.float16) 111 decoder_input_value = Tensor(np.ones((2, 10, 64)), mstype.float32) 112 decoder_input_mask = Tensor(np.ones((2, 10, 10)), mstype.float16) 113 memory_mask = Tensor(np.ones((2, 10, 20)), mstype.float16) 117 label = Tensor(np.ones((2 * seq,)), mstype.int32) 118 input_mask = Tensor(np.ones((2 * seq,)), mstype.float32) 145 encoder_input_value = Tensor(np.ones((2, 20, 64)), mstype.float32) 146 encoder_input_mask = Tensor(np.ones((2, 20, 20)), mstype.float16) [all …]
|