/third_party/mindspore/mindspore/ops/_grad/ |
D | grad_implementations.py | 30 def bprop_max_and_minimum_grad_grad(x, y, z, out, dout): argument 32 out0 = F.cast(out[0] != 0, get_dtype(dout[0])) 33 out1 = F.cast(out[1] != 0, get_dtype(dout[1])) 34 dz = out0 * dout[0] + out1 * dout[1] 39 def bprop_relu_grad_grad(x, y, out, dout): argument 42 dy = input_grad(dout, y) 47 def bprop_scalar_add(x, y, out, dout): argument 49 return dout, dout 53 def bprop_scalar_mul(x, y, out, dout): argument 55 return dout*y, dout*x [all …]
|
D | grad_math_ops.py | 64 def _sum_grad(x, axis, dout): argument 69 grad = reshape(dout, output_shape_kept_dims) 73 def _min_or_max_grad(x, axis, out, dout): argument 78 grad = reshape(dout, output_shape_kept_dims) 85 def _argmin_or_argmax_grad(x, axis, keep_dims, op, out, dout): argument 96 dout_expand = dout[1] 99 dout_expand = expand(dout[1], onehot_axis) 120 def bprop(x, w, out, dout): argument 122 dx = mul1(w, dout) 124 dx = mul1(dout, w) [all …]
|
D | grad_array_ops.py | 50 def bprop(dtype, dims, x, out, dout): argument 60 def bprop(dims, dtype, out, dout): argument 70 def bprop(dims, dtype, out, dout): argument 80 def bprop(x, out, dout): argument 90 def dout_cast_tensor(dout, x): argument 94 dx = cast(dout, get_dtype(x)) 99 def dout_cast_number(dout, x): argument 103 dx = cast(dout, get_dtype(x)) 108 def dout_cast_row_tensor(dout, x): argument 112 values = cast(dout.values, get_dtype(x)) [all …]
|
D | grad_comm_ops.py | 50 def bprop(x, out, dout): argument 51 dy1 = mul(dout, out) 58 def bprop(x, out, dout): argument 59 if F.issubclass_(F.typeof(dout), mstype.tensor): 60 dx = all_reduce_grad(dout) 62 indices = all_gather(dout.indices) 63 grad = all_gather(dout.values) 64 dx = RowTensor(indices, grad, dout.dense_shape) 68 def bprop(x, out, dout): argument 69 if F.issubclass_(F.typeof(dout), mstype.tensor): [all …]
|
D | grad_nn_ops.py | 38 def bprop(x, w, out, dout): argument 39 return dout, bias_grad(dout) 60 def bprop(x, w, out, dout): argument 67 dx = input_grad(dout, w, x_shape) 71 dw = filter_grad(dout, x, w_shape) 90 def bprop(x, w, out, dout): argument 91 dx = input_grad(w, dout, get_shape(x)) 92 dw = filter_grad(x, dout, get_shape(w)) 112 def bprop(x, w, out, dout): argument 113 dx = input_grad(dout, w) [all …]
|
D | grad_quant_ops.py | 31 def bprop(x, x_min, x_max, out, dout): argument 32 dx = op(dout, x, x_min, x_max) 44 def bprop(x, x_min, x_max, out, dout): argument 45 dx = op(dout, x, x_min, x_max) 57 def bprop(x, x_min, x_max, out, dout): argument 58 dx = op(dout, x, x_min, x_max) 73 def bprop(x, x_min, x_max, out, dout): argument 74 dx = op(dout, x, x_min, x_max) 85 def bprop(x, mean, variance, global_step, out, dout): argument 86 dx = op(dout[0], dout[1], x, out[0], out[1], global_step) [all …]
|
D | grad_inner_ops.py | 50 def bprop(x, y, out, dout): argument 51 shape = F.shape(dout) 52 dtype = get_dtype(dout) 54 dx = inner.MatrixDiagPart()(dout, assist) 65 def bprop(x, y, out, dout): argument 68 shape = F.shape(dout) 69 dtype = get_dtype(dout) 71 return inner.MatrixDiag()(dout, assist), zeros_like(y) 75 return inner.MatrixSetDiag()(zeros_like(x), dout, assist), zeros_like(y) 85 def bprop(x, y, z, out, dout): argument [all …]
|
D | grad_sparse.py | 27 def bprop_make_sparse_tensor(indices, values, dense_shape, out, dout): argument 29 return zeros_like(indices), F.sparse_tensor_get_values(dout), () 33 def bprop_sparse_tensor_get_indices(sparse_tensor, out, dout): argument 39 def bprop_sparse_tensor_get_values(sparse_tensor, out, dout): argument 42 dout, 47 def bprop_sparse_tensor_get_dense_shape(sparse_tensor, out, dout): argument 56 def bprop(indices, values, dense_shape, out, dout): argument 57 return zeros_like(indices), F.gather_nd(dout, indices), zeros_like(dense_shape) 69 def bprop(indices, values, dense_shape, dense, out, dout): argument 70 dense_grad = sparse_tensor_dense_mat_mul(indices, values, dense_shape, dout) [all …]
|
D | grad_other_ops.py | 31 def bprop(x, y, out, dout): argument 32 return (dout, zeros_like(y)) 40 def bprop(x, out, dout): argument 49 def bprop(x, y, out, dout): argument 59 def bprop(x, scale, b, mean, variance, out, dout): argument 62 out = input_grad(dout[0], x, scale, saved_mean, saved_variance) 74 def bprop(x, out, dout): argument 75 return (dout,)
|
D | grad_debug_ops.py | 29 def bprop(tag, x, out, dout): argument 38 def bprop(tag, x, out, dout): argument 47 def bprop(tag, x, out, dout): argument 56 def bprop(tag, x, out, dout): argument 66 def bprop(x, out, dout): argument 67 return (f(dout),)
|
/third_party/mindspore/tests/st/ops/gpu/ |
D | test_fake_quant_perchannel_grad.py | 32 def construct(self, dout, x, minq, maxq): argument 33 return self.op(dout, x, minq, maxq) 41 dout = np.random.uniform(-1, 1, size=[4]).astype('float32') 45 expect = dout 48 output = net(Tensor(dout), Tensor(x), Tensor(min_val), Tensor(max_val)) 63 dout = np.random.uniform(-1, 1, size=[4]).astype('float32') 67 expect = np.array([0.0, dout[1], dout[2], 0.0]).astype(np.float32) 70 output = net(Tensor(dout), Tensor(x), Tensor(min_val), Tensor(max_val)) 85 dout = np.random.uniform(-1, 1, size=[4]).astype('float32') 89 expect = np.array([0.0, dout[1], dout[2], 0.0]).astype(np.float32) [all …]
|
D | test_fake_quant_perlayer_grad.py | 31 def construct(self, dout, x, minq, maxq): argument 32 return self.op(dout, x, minq, maxq) 40 dout = np.random.uniform(-1, 1, size=[6]).astype('float32') 44 expect = np.array([0.0, dout[1], dout[2], dout[3], dout[4], 0.0]).astype(np.float32) 47 output = net(Tensor(dout), Tensor(x), Tensor(min_val), Tensor(max_val)) 61 dout = np.random.uniform(-1, 1, size=[6]).astype('float32') 65 expect = np.array([0.0, dout[1], dout[2], dout[3], dout[4], 0.0]).astype(np.float32) 68 output = net(Tensor(dout), Tensor(x), Tensor(min_val), Tensor(max_val)) 82 dout = np.random.uniform(-1, 1, size=[6]).astype('float32') 86 expect = np.array([0.0, dout[1], dout[2], dout[3], dout[4], 0.0]).astype(np.float32) [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/ |
D | unary_op_grad_impl.cu | 20 __global__ void SqrtGradKernel(const T *input, const T *dout, T *output, const size_t count) { in SqrtGradKernel() argument 23 float dout_f = static_cast<float>(dout[i]); in SqrtGradKernel() 31 __global__ void RsqrtGradKernel(const T *input, const T *dout, T *output, const size_t count) { in RsqrtGradKernel() argument 34 float dout_f = static_cast<float>(dout[i]); in RsqrtGradKernel() 43 __global__ void AsinGradKernel(const T *input, const T *dout, T *output, const size_t count) { in AsinGradKernel() argument 47 output[i] = dout[i] / sqt; in AsinGradKernel() 53 __global__ void AsinGradKernel(const half *input, const half *dout, half *output, const size_t coun… in AsinGradKernel() argument 57 output[i] = dout[i] / sqt; in AsinGradKernel() 63 __global__ void ACosGradKernel(const T *input, const T *dout, T *output, const size_t count) { in ACosGradKernel() argument 68 output[i] = neg_one * dout[i] / sqt; in ACosGradKernel() [all …]
|
D | unary_op_grad_impl.cuh | 22 void SqrtGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_strea… 24 void RsqrtGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_stre… 26 void AsinGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_strea… 28 void ACosGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_strea… 30 void AtanGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_strea… 32 void AsinhGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_stre… 34 void AcoshGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda_stre… 36 void ReciprocalGrad(const T *input, const T *dout, T *output, const size_t count, cudaStream_t cuda…
|
/third_party/mindspore/mindspore/ops/_grad_experimental/ |
D | grad_array_ops.py | 33 def bprop(input_data, mask, value, out, dout): argument 35 dinput = mul_op(dout, (1 - mask)) 36 dvalue = mul_op(dout, mask) 55 def bprop(x, indices, update, out, dout): argument 56 update_grad = neg(gather_nd(dout, indices)) 57 return dout, zeros_like(indices), update_grad 62 def tensor_scatter_possible_replacement(x, indices, updates, out, dout): argument 74 dx = dout * F.cast(x_indicators, F.dtype(dout)) / F.cast(indicators, F.dtype(dout)) 75 …dupdates = gather_nd(dout / F.cast(indicators, F.dtype(dout)), indices) * F.cast(out_indicators, F… 83 def bprop(x, indices, updates, out, dout): argument [all …]
|
D | grad_math_ops.py | 42 def bprop(input_x, input_y, out, dout): argument 43 dout_shape = F.shape(dout) 49 dout_transpose = transpose(dout, dout_perm) 51 dx = input_grad(dout, input_x, input_y, out) 65 def bprop(start, end, weight, out, dout): argument 66 dout = F.cast(dout, mstype.float32) 67 dstart = mul_op(dout, 1 - weight) 68 dend = mul_op(dout, weight) 69 dweight = mul_op(dout, sub_op(end, start)) 92 def bprop(input_x, out, dout): argument [all …]
|
D | grad_nn_ops.py | 30 def bprop(log_probs, targets, input_lengths, target_lengths, out, dout): argument 31 … grad = ctc_loss_grad(dout[1], log_probs, targets, input_lengths, target_lengths, out[0], out[1]) 43 def bprop(predict, label, out, dout): argument 44 dx = grad(predict, label, dout) 45 dy = grad(label, predict, dout) 56 def bprop(input_x, out, dout): argument 57 dx = input_grad(dout, input_x)
|
/third_party/mindspore/tests/vm_impl/ |
D | nn_ops_vm_impl.py | 133 def vm_impl(x, dout, argmax): argument 135 dout = dout.asnumpy() 137 dx = vm.max_pool_grad_with_argmax(x, dout, arg_max, 172 def vm_impl(x, out, dout): argument 174 dout = dout.asnumpy() 175 … out = vm.max_pool_grad(x, dout, self.kernel_size[-2], self.kernel_size[-1], self.strides[-2]) 197 def vm_impl(dout, origin_shape): argument 198 dout = dout.asnumpy() 199 …out = vm.avg_pool_grad(dout, origin_shape, self.kernel_size[-2], self.kernel_size[-1], self.stride… 239 def vm_impl(dout, w, x_size): argument [all …]
|
D | vm_me.py | 48 def avg_pool_grad(dout, origin_shape, pool_h, pool_w, stride): argument 63 _, _, height, width = dout.shape 121 def _batch_norm_grad(dout, x, scale, save_mean, save_inv_variance, \ argument 133 dx_norm = scale * dout 138 dgamma = np.sum(dout * x_norm, axis=0) 139 dbeta = np.sum(dout, axis=0) 284 def conv2d_backprop_filter(dout, x, w_size, stride=1, pad=0): argument 287 dout = dout.transpose(0, 2, 3, 1).reshape(-1, filter_num) 289 dw = np.dot(col.T, dout) 294 def conv2d_backprop_input(dout, x_size, weight, stride=1, pad=0): argument [all …]
|
/third_party/mesa3d/src/amd/common/ |
D | ac_surface_meta_address_test.c | 206 ADDR2_COMPUTE_DCCINFO_OUTPUT dout = {sizeof(dout)}; in one_dcc_address_test() local 211 dout.pMipInfo = meta_mip_info; in one_dcc_address_test() 226 int ret = Addr2ComputeDccInfo(addrlib, &din, &dout); in one_dcc_address_test() 249 in.compressBlkWidth = dout.compressBlkWidth; in one_dcc_address_test() 250 in.compressBlkHeight = dout.compressBlkHeight; in one_dcc_address_test() 251 in.compressBlkDepth = dout.compressBlkDepth; in one_dcc_address_test() 252 in.metaBlkWidth = dout.metaBlkWidth; in one_dcc_address_test() 253 in.metaBlkHeight = dout.metaBlkHeight; in one_dcc_address_test() 254 in.metaBlkDepth = dout.metaBlkDepth; in one_dcc_address_test() 255 in.dccRamSliceSize = dout.dccRamSliceSize; in one_dcc_address_test() [all …]
|
/third_party/mindspore/tests/st/ops/cpu/ |
D | test_bias_add_grad.py | 31 def construct(self, dout): argument 32 return self.bias_add_grad(dout) 39 dout = np.ones([2, 3]).astype(np.float32) 41 output = bias_add_grad(Tensor(dout)) 51 dout = np.ones([2, 3, 4, 4]).astype(np.float32) 53 output = bias_add_grad(Tensor(dout)) 62 dout = np.ones([2, 3, 4, 4, 2]).astype(np.float32) 64 output = bias_add_grad(Tensor(dout))
|
D | test_l2normalize_grad_op.py | 31 def construct(self, input_x, output, dout): argument 32 return self.ops(input_x, output, dout) 43 dout = np.arange(24, 48).astype(np.float32).reshape((2, 3, 4)) 45 except_asn = (dout - output * np.sum(output * dout, axis=axis, keepdims=True) 49 dout = Tensor(dout, mstype.float32) 50 net_output = net(input_x, output, dout).asnumpy()
|
/third_party/mindspore/tests/st/ops/graph_kernel/ |
D | test_bias_add_grad.py | 29 def construct(self, dout): argument 30 return self.bias_add_grad(dout) 33 def get_output(dout, enable_graph_kernel=False): argument 36 output = opt(Tensor(dout)) 41 dout = np.random.normal(0, 1, shape).astype(dtype) 43 expect = get_output(dout, False) 44 output = get_output(dout, True)
|
D | test_sqrt_grad.py | 28 def construct(self, x, dout): argument 29 return self.sqrt_grad(x, dout) 32 def get_output(x, dout, enable_graph_kernel=False): argument 35 output = net(x, dout) 41 dout = Tensor(np.random.normal(0, 1, shape_dout).astype(dtype)) 43 expect = get_output(x, dout, False) 44 output = get_output(x, dout, True)
|
/third_party/mindspore/mindspore/nn/layer/ |
D | thor_layer.py | 144 def save_gradient(self, dout): argument 149 out = dout 152 shape = self.shape(dout) 154 matrix_g = self.cube_matmul(dout, dout) 158 dout_shape = self.shape(dout) 160 matrix_g = self.cube_matmul(dout, dout) 445 def save_gradient(self, dout): argument 447 out = dout 449 dout_shape = self.shape(dout) 450 dout = self.transpose(dout, (0, 2, 3, 1)) [all …]
|