Home
last modified time | relevance | path

Searched refs:grad_shape (Results 1 – 22 of 22) sorted by relevance

/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ps/
Dsparse_apply_adam_ps_kernel.cc39 const std::vector<size_t> &grad_shape = *(shape_vec[9]); in InitKernel() local
54 if (var_shape.size() != grad_shape.size()) { in InitKernel()
59 if (var_shape[i] != grad_shape[i]) { in InitKernel()
68 if (grad_shape[0] != indices_size_) { in InitKernel()
Dsparse_apply_lazy_adam_ps_kernel.cc40 const std::vector<size_t> &grad_shape = *(shape_vec[9]); in InitKernel() local
50 if (var_shape.size() != grad_shape.size()) { in InitKernel()
61 if (var_shape[i] != grad_shape[i]) { in InitKernel()
70 if (grad_shape[0] != indices_size_) { in InitKernel()
Dsparse_apply_ftrl_ps_kernel.cc37 std::vector<size_t> grad_shape = *(shape_vec[3]); in InitKernel() local
44 if (var_shape.size() != grad_shape.size()) { in InitKernel()
54 if (var_shape[i] != grad_shape[i]) { in InitKernel()
63 if (grad_shape[0] != indices_size_) { in InitKernel()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/
Davgpool_3d_grad_fusion.cc127 std::vector<int64_t> grad_shape; in ConstructMultiplier() local
128 …(void)std::transform(ori_shape.begin(), ori_shape.end(), std::back_inserter(grad_shape), SizeToLon… in ConstructMultiplier()
129 std::vector<int64_t> assist_shape = grad_shape; // NCDHW in ConstructMultiplier()
139 for (int64_t nn = 0; nn < grad_shape[kDim0]; nn++) { in ConstructMultiplier()
140 for (int64_t cc = 0; cc < grad_shape[kDim1]; cc++) { in ConstructMultiplier()
142 for (int64_t di = 0; di < grad_shape[kDim2]; di++) { in ConstructMultiplier()
144 for (int64_t hi = 0; hi < grad_shape[kDim3]; hi++) { in ConstructMultiplier()
146 for (int64_t wi = 0; wi < grad_shape[kDim4]; wi++) { in ConstructMultiplier()
/third_party/mindspore/mindspore/ccsrc/fl/server/kernel/
Ddense_grad_accum_kernel.h48 …std::vector<size_t> grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, cnode_grad_idx); in InitKernel() local
49 …size_t grad_size = std::accumulate(grad_shape.begin(), grad_shape.end(), sizeof(T), std::multiplie… in InitKernel()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/
Dsparse_apply_proximal_adagrad_cpu_kernel.cc89 std::vector<size_t> grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 5); in InitKernel() local
97 if (var_shape.size() != grad_shape.size()) { in InitKernel()
102 if (var_shape[i] != grad_shape[i]) { in InitKernel()
111 if (grad_shape[0] != indices_size_) { in InitKernel()
Dsparse_apply_ftrl_cpu_kernel.cc91 std::vector<size_t> grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 3); in InitKernel() local
102 if (var_shape.size() != grad_shape.size()) { in InitKernel()
108 if (var_shape[i] != grad_shape[i]) { in InitKernel()
117 if (grad_shape[0] != indices_size_) { in InitKernel()
Dsparse_apply_lazy_adam_cpu_kernel.cc87 std::vector<size_t> grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 9); in InitKernel() local
98 if (var_shape.size() != grad_shape.size()) { in InitKernel()
104 if (var_shape[i] != grad_shape[i]) { in InitKernel()
113 if (grad_shape[0] != indices_size_) { in InitKernel()
Dsparse_apply_adam_cpu_kernel.cc108 std::vector<size_t> grad_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 9); in InitKernel() local
119 if (var_shape.size() != grad_shape.size()) { in InitKernel()
124 if (var_shape[i] != grad_shape[i]) { in InitKernel()
133 if (grad_shape[0] != indices_size_) { in InitKernel()
Dadam_delta_cpu_kernel.cc66 std::vector<size_t> grad_shape = AnfAlgo::GetInputDeviceShape(kernel_node, 8); in InitKernel() local
74 if (!IsSameShape(delta_shape, grad_shape)) { in InitKernel()
/third_party/mindspore/mindspore/core/ops/grad/
Davg_pool_3d_grad.cc38 …auto grad_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[1]->GetShapeTrack())[… in InferShape() local
39 …(void)CheckAndConvertUtils::CheckInteger("grad_rank", SizeToLong(grad_shape.size()), kEqual, k5DIn… in InferShape()
Dcdist_grad.cc32 …auto grad_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[0]->BuildShape())[kSh… in InferShape() local
38 …CheckAndConvertUtils::Check("grad shape", grad_shape, kEqual, "cdist shape", cdist_shape, prim_nam… in InferShape()
/third_party/mindspore/mindspore/core/ops/
Dadam.cc34 …auto grad_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[kInputIndex9]->GetSha… in AdamInfer() local
37 CheckAndConvertUtils::Check("var_shape", var_shape, kEqual, "grad_shape", grad_shape, prim_name); in AdamInfer()
Dsparse_apply_r_m_s_prop.cc44 …auto grad_shape = CheckAndConvertUtils::ConvertShapePtrToShapeMap(input_args[4]->BuildShape())[kSh… in InferShape() local
54 (void)same_shape_args_map.insert(std::make_pair("shape of grad ", grad_shape)); in InferShape()
/third_party/mindspore/mindspore/ops/operations/
Dnn_ops.py3128 …ape(self, var_shape, mean_square_shape, moment_shape, learning_rate_shape, grad_shape, decay_shape, argument
3132 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
3245 … def infer_shape(self, var_shape, mean_gradient_shape, mean_square_shape, moment_shape, grad_shape, argument
3250 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
4596 beta1_shape, beta2_shape, epsilon_shape, grad_shape): argument
4599 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
4703 epsilon_shape, decay_shape, grad_shape): argument
4706 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
4816 beta1_shape, beta2_shape, epsilon_shape, grad_shape): argument
4817 validator.check("grad_shape", grad_shape, "m_shape", m_shape, Rel.EQ, self.name)
[all …]
Dinner_ops.py262 def infer_shape(self, grad_shape, v_shape, m_shape, var_shape, beta1_shape, sub1_shape, argument
266 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
544 epsilon_shape, decay_shape, grad_shape): argument
547 validator.check("var_shape", var_shape, "grad_shape", grad_shape, Rel.EQ, self.name)
D_grad_ops.py830 def infer_shape(self, x1_shape, x2_shape, grad_shape): argument
844 def infer_shape(self, x1_shape, grad_shape): argument
882 def infer_shape(self, x1_shape, x2_shape, grad_shape): argument
925 def infer_shape(self, x1_shape, x2_shape, grad_shape): argument
993 def infer_shape(self, x_shape, y_shape, grad_shape): argument
1019 def infer_shape(self, x_shape, y_shape, grad_shape): argument
1021 validator.check('x_shape', x_shape, 'grad_shape', grad_shape, prim_name=self.name)
1054 def infer_shape(self, x_shape, grad_shape, argmax_shape): argument
1055 if not grad_shape:
1100 def infer_shape(self, x_shape, grad_shape, argmax_shape): argument
[all …]
/third_party/mindspore/mindspore/ops/_grad/
Dgrad_inner_ops.py91 grad_shape = F.shape(dout)
93 assist = _get_matrix_diag_part_assist(grad_shape, grad_dtype)
/third_party/mindspore/mindspore/nn/optim/
Doptimizer.py687 grad_shape = F.shape(gradient)
689 for i in range(1, len(grad_shape)):
692 if grad_shape[1] % 16 != 0:
704 grad_shape = F.shape(gradient)
705 for i in range(1, len(grad_shape)):
708 if grad_shape[1] % 16 != 0:
Dthor.py1126 grad_shape = self.shape(g)
1128 if grad_shape[0] == 1001:
1145 … g = self.reshape(g, (grad_shape[0], grad_shape[1] * grad_shape[2] * grad_shape[3]))
1153 g = self.reshape(g, grad_shape)
1194 grad_shape = self.shape(g)
1196 if grad_shape[0] == 1001:
1216 g = self.reshape(g, (grad_shape[0], grad_shape[1] * grad_shape[2] * grad_shape[3]))
1224 g = self.reshape(g, grad_shape)
Dadafactor.py77 grad_shape = F.shape(grad)
85 factored = len(grad_shape) >= 2
/third_party/mindspore/mindspore/ccsrc/pybind_api/ir/
Dprimitive_py.cc117 py::tuple grad_shape = grads[i].attr("shape"); in check_bprop_out() local
124 if (!grad_shape.equal(arg_shape)) { in check_bprop_out()
128 … << ", the gradient shape is: " << py::cast<py::str>(grad_shape) << "."; in check_bprop_out()