Home
last modified time | relevance | path

Searched refs:input_x (Results 1 – 25 of 255) sorted by relevance

1234567891011

/third_party/mindspore/tests/syntax/simple_expression/
Dtest_math_ops.py36 input_x = 0.1
38 result1 = input_x + input_y
40 result2 = add_net(input_x, input_y)
47 input_x = Tensor(np.ones(shape=[3])).astype(np.int8)
49 result1 = input_x + input_y
51 result2 = add_net(input_x, input_y)
58 input_x = Tensor(np.ones(shape=[3])).astype(np.int16)
60 result1 = input_x + input_y
62 result2 = add_net(input_x, input_y)
69 input_x = Tensor(np.ones(shape=[3])).astype(np.int32)
[all …]
Dtest_assignment_ops.py201 input_x = 2
204 result1 += input_x
205 assignadd = AssignAdd(result2, input_x)
213 input_x = Tensor(np.array([[2, 2], [3, 3]]))
216 result1 += input_x
217 result2 = AssignAdd(result2, input_x)()
224 input_x = 3
227 result1 += input_x
228 result2 = AssignAdd(result2, input_x)()
237 input_x = Tensor(np.array([[4, -2], [2, 17]])).astype(np.float16)
[all …]
/third_party/mindspore/tests/st/auto_monad/
Dtest_effect_ops.py81 def __init__(self, input_x): argument
83 self.input_x = Parameter(input_x, name="para")
87 self.scatter_add(self.input_x, indices, updates)
88 return self.input_x
96 input_x = Tensor(np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]), mstype.float32)
100 net = ScatterAddNet(input_x)
106 def __init__(self, input_x): argument
108 self.input_x = Parameter(input_x, name="para")
112 self.scatter_sub(self.input_x, indices, updates)
113 return self.input_x
[all …]
/third_party/mindspore/mindspore/nn/probability/distribution/_utils/
Dcustom_ops.py21 def exp_generic(input_x): argument
31 if not checktype(dtype(input_x), mstype.float_):
32 input_x = cast(input_x, mstype.float32)
33 return exp(input_x)
36 def log_generic(input_x): argument
53 if not checktype(dtype(input_x), mstype.float_):
54 input_x = cast(input_x, mstype.float32)
55 nan = fill(dtype(input_x), shape(input_x), np.nan)
56 inf = fill(dtype(input_x), shape(input_x), np.inf)
57 neg_x = less(input_x, 0.0)
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/
Dbinary_cross_entropy_grad_kernel.cc29 const auto *input_x = reinterpret_cast<T *>(inputs[0]->addr); in LaunchKernel() local
40 …T denominator = ((input_x[i] * (one - input_x[i])) > epsilon) ? (input_x[i] * (one - input_x[i])) … in LaunchKernel()
41 T value = weight[i] * (input_x[i] - input_y[i]) / denominator; in LaunchKernel()
46 …T denominator = ((input_x[i] * (one - input_x[i])) > epsilon) ? (input_x[i] * (one - input_x[i])) … in LaunchKernel()
47 T value = (input_x[i] - input_y[i]) / denominator; in LaunchKernel()
58 …T denominator = ((input_x[i] * (one - input_x[i])) > epsilon) ? (input_x[i] * (one - input_x[i])) … in LaunchKernel()
59 T value = weight[i] * (input_x[i] - input_y[i]) / denominator; in LaunchKernel()
64 …T denominator = ((input_x[i] * (one - input_x[i])) > epsilon) ? (input_x[i] * (one - input_x[i])) … in LaunchKernel()
65 T value = (input_x[i] - input_y[i]) / denominator; in LaunchKernel()
/third_party/mindspore/tests/st/ops/gpu/
Dtest_squared_difference_op.py40 input_x = np.random.uniform(10, 20, (3, 4, 5, 2)).astype(np.float16)
42 output = net(Tensor(input_x), Tensor(input_y)).asnumpy()
43 diff = input_x-input_y
55 input_x = np.random.rand(3, 4, 5, 2).astype(np.float32)
57 output = net(Tensor(input_x), Tensor(input_y)).asnumpy()
58 diff = input_x-input_y
70 input_x = np.random.rand(3, 4, 5, 2).astype(np.int32)
72 output = net(Tensor(input_x), Tensor(input_y)).asnumpy()
73 diff = input_x-input_y
85 input_x = np.random.rand(1, 4, 1, 2).astype(np.int32)
[all …]
Dtest_unsorted_segment_sum.py42 input_x = Tensor([1, 2, 3, 4], mstype.float32)
47 output = net(input_x, segment_ids)
57 input_x = Tensor([[1, 2, 3, 4],
64 output = net(input_x, segment_ids)
77 input_x = Tensor(np.arange(4 * 5 * 3, dtype=np.float32).reshape(4, 5, 3))
82 output = net(input_x, segment_ids)
140 input_x = Tensor([1, 2, 3, 4], mstype.float32)
142 output = net(input_x, segment_ids)
146 input_x = Tensor([[1, 2, 3, 4],
150 output = net(input_x, segment_ids)
[all …]
Dtest_unsorted_segment_max.py43 input_x = Tensor([1, 2, 3, 4], mstype.int32)
47 output = net(input_x, segment_ids)
57 input_x = Tensor([[1, 2, 3, 4],
63 output = net(input_x, segment_ids)
76 input_x = Tensor(np.arange(
81 output = net(input_x, segment_ids).asnumpy()
115 input_x = Tensor(np.arange(
120 output = net(input_x, segment_ids).asnumpy()
144 input_x = Tensor(np.arange(
150 output = net(input_x, segment_ids, num_segments).asnumpy()
[all …]
Dtest_unsorted_segment_min.py43 input_x = Tensor([1, 2, 3, 4], mstype.int32)
47 output = net(input_x, segment_ids).asnumpy()
57 input_x = Tensor([[1, 2, 3, 4],
63 output = net(input_x, segment_ids).asnumpy()
76 input_x = Tensor(np.arange(
81 output = net(input_x, segment_ids).asnumpy()
115 input_x = Tensor(np.arange(
120 output = net(input_x, segment_ids).asnumpy()
144 input_x = Tensor(np.arange(
150 output = net(input_x, segment_ids, num_segments).asnumpy()
[all …]
/third_party/toybox/kconfig/lxdialog/
Dinputbox.c48 int input_x = 0, scroll = 0, key = 0, button = -1; in dialog_inputbox() local
100 input_x = strlen(instr); in dialog_inputbox()
102 if (input_x >= box_width) { in dialog_inputbox()
103 scroll = input_x - box_width + 1; in dialog_inputbox()
104 input_x = box_width - 1; in dialog_inputbox()
111 wmove(dialog, box_y, box_x + input_x); in dialog_inputbox()
130 if (input_x || scroll) { in dialog_inputbox()
132 if (!input_x) { in dialog_inputbox()
137 instr[scroll + input_x + i] ? in dialog_inputbox()
138 instr[scroll + input_x + i] : ' '); in dialog_inputbox()
[all …]
/third_party/mindspore/tests/st/ops/cpu/
Dtest_split_op.py43 input_x = Tensor(np.arange(24).astype(np.int32).reshape((2, 2, 6)))
44 outputs = op_wrapper(input_x)
58 input_x = Tensor(np.arange(24).astype(np.int32).reshape((2, 2, 6)))
59 outputs = op_wrapper(input_x)
75 input_x = Tensor(np.arange(24).astype(np.float32).reshape((2, 2, 6)))
76 outputs = op_wrapper(input_x)
90 input_x = Tensor(np.arange(192).astype(np.float32).reshape((2, 2, 2, 2, 2, 6)))
91 outputs = op_wrapper(input_x)
98 outputs = op_wrapper(input_x)
112 input_x = Tensor(np.arange(192).astype(np.float64).reshape((2, 2, 2, 2, 2, 6)))
[all …]
Dtest_l2normalize_grad_op.py31 def construct(self, input_x, output, dout): argument
32 return self.ops(input_x, output, dout)
42 input_x = np.arange(24).astype(np.float32).reshape((2, 3, 4))
44 output = input_x / np.sqrt(np.sum(input_x**2, axis=axis, keepdims=True))
46 ) / np.sqrt(np.sum(input_x**2, axis=axis, keepdims=True))
47 input_x = Tensor(input_x, mstype.float32)
50 net_output = net(input_x, output, dout).asnumpy()
/third_party/mindspore/mindspore/_extends/graph_kernel/expanders/
Dsoftmax.py28 input_x = self.inputs[0]
32 ori_shape = input_x.shape
33 if input_x.data_format == DF.FRAC_NZ:
34 ori_shape = infer_shape_from_fractalnz(input_x.shape)
42 if input_x.data_format == DF.FRAC_NZ:
45 ori_dtype = input_x.dtype
47 input_x_f16 = graph_builder.emit('Cast', [input_x], attrs={'dst_type': 'float16'})
51 … max_x = graph_builder.emit('ReduceMax', [input_x], attrs={'reduce_axis': axis, 'keep_dims': True})
55 input_x = graph_builder.emit('Cast', [input_x], attrs={'dst_type': "float32"})
57 if input_x.data_format == DF.FRAC_NZ:
[all …]
Dlayernorm.py28 input_x, input_gamma, input_beta = self.inputs
33 ori_dtype = input_x.dtype
35 input_x = graph_builder.emit('Cast', [input_x], attrs={'dst_type': 'float32'})
39 ori_shape_x = input_x.shape
40 if input_x.data_format == DF.FRAC_NZ:
58 if input_x.data_format == DF.FRAC_NZ:
62 mean_cof_v = graph_builder.value(input_x.dtype, mean_cof)
65 mean_red = graph_builder.emit('ReduceSum', [input_x],
68 if input_x.data_format == DF.FRAC_NZ:
72 variance_sub = graph_builder.emit('Sub', [input_x, mean])
[all …]
Dbatchnorm.py30 input_x = self.inputs[0]
37 input_x_ori_type = input_x.dtype
38 input_x_new_type = input_x.dtype
39 …if input_x.dtype == "float16" and input_scale.dtype == "float32" and input_offset.dtype == "float3…
43 input_x = graph_builder.emit('Cast', [input_x], attrs={'dst_type': input_x_new_type})
46 self.inputs[0] = input_x
52 if input_x.data_format in (DF.DEFAULT, DF.NCHW):
59 x_sub = graph_builder.emit('Sub', [input_x, input_mean])
63 if input_x.data_format in (DF.DEFAULT, DF.NCHW):
74 input_x = self.inputs[0]
[all …]
Derfc.py23 input_x = self.inputs[0]
25 if input_x.dtype == "float16":
27 input_x = graph_builder.emit('Cast', [input_x], attrs={'dst_type': "float32"})
28 erf_result = graph_builder.emit('Erf', [input_x])
32 const_one = graph_builder.value(input_x.dtype, 1)
33 erf_result = graph_builder.emit('Erf', [input_x])
Dgkdropout.py25 input_x, input_mask = self.inputs
28 r_keep_prob = graph_builder.value(input_x.dtype, 1.0 / keep_prob)
29 keep_prob = graph_builder.value(input_x.dtype, keep_prob)
31 if input_mask.dtype != input_x.dtype:
32 input_mask = graph_builder.emit('Cast', [input_mask], attrs={'dst_type': input_x.dtype})
34 mask = graph_builder.emit('Cast', [mask], attrs={'dst_type': input_x.dtype})
37 result = graph_builder.emit('Mul', [r_keep_prob, input_x])
/third_party/mindspore/mindspore/ops/_op_impl/_custom_op/
Dtranspose02314_impl.py61 def cus_transpose02314(input_x, output, kernel_name="cus_transpose021354"): argument
63 input_x_shape = input_x.get("shape")
71 input_x = tik_instance.Tensor("float16", input_x_shape, name="input_x", scope=tik.scope_gm)
76 tik_instance, res = shape0(tik_instance, input_x, res, dtype)
78 tik_instance, res = shape1(tik_instance, input_x, res, dtype)
80 tik_instance, res = shape2(tik_instance, input_x, res, dtype)
82 tik_instance, res = shape3(tik_instance, input_x, res, dtype)
84 tik_instance, res = shape4(tik_instance, input_x, res, dtype)
86 tik_instance, res = shape5(tik_instance, input_x, res, dtype)
88 tik_instance, res = shape6(tik_instance, input_x, res, dtype)
[all …]
Dfused_abs_max1_impl.py76 def shape0(tik_instance, input_x_shape, input_x, res): argument
88 tik_instance.data_move(input_x_ub, input_x[each_block_element * block_index], 0, 1,
100 def shape1(tik_instance, input_x_shape, ori_shape, input_x, res): argument
111 tik_instance.data_move(input_x_ub, input_x[512 * block_index], 0, 1, 512 // 8, 0, 0)
113 tik_instance.data_move(input_x_ub[512], input_x[16384 + 128 * line_id], 0, 1, 8, 0, 0)
132 tik_instance.data_move(input_x_ub, input_x[each_block_element * block_index], 0, 1,
146 def shape2(tik_instance, input_x_shape, input_x, res): argument
158 tik_instance.data_move(input_x_ub, input_x[each_block_element * block_index], 0, 1,
171 def shape3_1000(tik_instance, input_x, res): argument
181 tik_instance.data_move(input_x_ub, input_x[phase_0 * block_index], 0, 1, phase_0 // 8, 0, 0)
[all …]
Dimg2col_impl.py37 def shape56_0(tik_instance, input_x, res, input_shape, shape_info): argument
47 … tik_instance.data_move(input_1_1_local_l1, input_x[block_index, 0, 0, 0, 0], 0, 1, 12544, 0, 0)
64 def shape56_1(tik_instance, input_x, res, input_shape, shape_info): argument
74 … tik_instance.data_move(input_1_1_local_l1, input_x[block_index, 0, 0, 0, 0], 0, 1, 25088, 0, 0)
92 def shape56_2(tik_instance, input_x, res, input_shape, shape_info): argument
102 … tik_instance.data_move(input_1_1_local_l1, input_x[block_index, 0, 0, 0, 0], 0, 1, 12544, 0, 0)
116 def shape56_3(tik_instance, input_x, res, input_shape, shape_info): argument
129 …tik_instance.data_move(input_1_1_local_l1, input_x[block_index, eeb0 * 8, 0, 0, 0], 0, 1, 25088, 0…
144 def shape56_4(tik_instance, input_x, res, input_shape, shape_info): argument
156 …tik_instance.data_move(input_1_1_local_l1, input_x[block_index, eeb0 * 8, 0, 0, 0], 0, 1, 25088, 0…
[all …]
/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_call_innetr_net_attr.py33 def construct(self, input_x): argument
35 return input_x * self.t
36 return input_x * self.weight
46 def construct(self, input_x): argument
48 return self.inner_in_net.t / self.inner_in_net(input_x)
49 return self.inner_in_net.weight / self.inner_in_net(input_x)
61 def construct(self, input_x, input_y): argument
64 return self.inner_net.t + self.inner_net(input_x) - input_y
72 def construct(self, input_x, input_y): argument
83 def construct(self, input_x, input_y): argument
[all …]
/third_party/mindspore/tests/st/ops/graph_kernel/
Dtest_gelu.py56 input_x = np.random.normal(0, 1, [2, 3, 4, 3]).astype(np.float32)
57 expect = gelu(input_x, False)
58 result = gelu(input_x, True)
63 tanh_res = np.tanh(0.7978845608 * (input_x + 0.044715 * input_x * input_x * input_x))
64 mul_right = 0.7978845608 + 0.1070322244 * input_x * input_x
65 dx = 0.5 * (1.0 + tanh_res) + 0.5 * input_x * (1.0 - tanh_res * tanh_res) * mul_right
69 def gelu_grad(input_dy, input_x, input_y, enable_graph_kernel=False): argument
72 result = net(Tensor(input_dy), Tensor(input_x), Tensor(input_y))
78 input_x = np.random.normal(0, 1, [2, 3, 4, 3]).astype(np.float32)
79 input_y = cal_gelu(input_x)
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/infer/
Dlayer_norm_grad_infer.c28 const TensorC *input_x = inputs[0]; in LayerNormGradInferShape() local
32 SetDataTypeFormat(output_dx, input_x); in LayerNormGradInferShape()
33 SetDataTypeFormat(output_dg, input_x); in LayerNormGradInferShape()
34 SetDataTypeFormat(output_db, input_x); in LayerNormGradInferShape()
35 SetShapeTensor(output_dx, input_x); in LayerNormGradInferShape()
38 begin_params_axis += (int)(input_x->shape_size_); in LayerNormGradInferShape()
41 if (input_x->shape_size_ > MAX_SHAPE_SIZE) { in LayerNormGradInferShape()
44 for (int i = begin_params_axis; i < input_x->shape_size_; i++) { in LayerNormGradInferShape()
48 output_dg->shape_[size] = input_x->shape_[i]; in LayerNormGradInferShape()
49 output_db->shape_[size] = input_x->shape_[i]; in LayerNormGradInferShape()
/third_party/mindspore/mindspore/core/ops/
Dbroadcast_to.cc29 auto input_x = GetValue<std::vector<int64_t>>(value_ptr); in BroadcastToInferShape() local
30 …ls::Check("x shape", SizeToLong(x_shape.size()), kLessEqual, "input_x", SizeToLong(input_x.size()), in BroadcastToInferShape()
32 auto outer_dim_offset = input_x.size() - x_shape.size(); in BroadcastToInferShape()
34 if (input_x.end() == find(input_x.begin(), input_x.end(), -1)) { in BroadcastToInferShape()
41 for (size_t i = 0; i < input_x.size(); i++) { in BroadcastToInferShape()
42 if (input_x[i] == -1) { in BroadcastToInferShape()
49 input_x[i] = x_shape[i - outer_dim_offset]; in BroadcastToInferShape()
53 auto x_shape_ptr = std::make_shared<abstract::Shape>(input_x); in BroadcastToInferShape()
54 (void)primitive->AddAttr("shape", MakeValue(input_x)); in BroadcastToInferShape()
56 if (input_x[i + outer_dim_offset] != x_shape[i] && x_shape[i] != 1) { in BroadcastToInferShape()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/
Dloss_with_reduction_impl.cu137 __global__ void KLDivLossKernel(const int input_size, const int reduction, const T *input_x, const … in KLDivLossKernel() argument
143 T value = input_y[i] * (logT(denominator) - input_x[i]); in KLDivLossKernel()
149 T value = input_y[i] * (logT(denominator) - input_x[i]); in KLDivLossKernel()
156 void KLDivLoss(const int &input_size, const int &reduction, const T *input_x, const T *input_y, T *… in KLDivLoss() argument
159 …<<<GET_BLOCKS(input_size), GET_THREADS, 0, stream>>>(input_size, reduction, input_x, input_y, loss, in KLDivLoss()
176 __global__ void KLDivLossGradKernel(const int input_size, const int reduction, const T *input_x, co… in KLDivLossGradKernel() argument
184 dy[i] = (logT(denominator) + one - input_x[i]) * dloss[i]; in KLDivLossGradKernel()
194 dy[i] = (logT(denominator) + one - input_x[i]) * dloss1; in KLDivLossGradKernel()
200 void KLDivLossGrad(const int &input_size, const int &reduction, const T *input_x, const T *input_y,… in KLDivLossGrad() argument
202 …Kernel<<<GET_BLOCKS(input_size), GET_THREADS, 0, stream>>>(input_size, reduction, input_x, input_y, in KLDivLossGrad()
[all …]

1234567891011