Home
last modified time | relevance | path

Searched refs:reduce_sum (Results 1 – 25 of 70) sorted by relevance

123

/third_party/mindspore/tests/ut/cpp/parallel/ops_info/
Dreduce_method_test.cc31 ReduceSumInfoPtr reduce_sum; variable
66 reduce_sum = std::make_shared<ReduceSumInfo>("sum_info", inputs_shape, outputs_shape, attr); in SetUp()
67 reduce_sum->set_input_value(val); in SetUp()
74 reduce_sum->Init(strategy); in TEST_F()
75 Shape dev_matrix_shape = reduce_sum->dev_matrix_shape(); in TEST_F()
85 reduce_sum->Init(strategy); in TEST_F()
86 std::vector<TensorInfo> inputs = reduce_sum->inputs_tensor_info(); in TEST_F()
87 std::vector<TensorInfo> outputs = reduce_sum->outputs_tensor_info(); in TEST_F()
106 reduce_sum->Init(strategy); in TEST_F()
107 std::vector<TensorInfo> inputs = reduce_sum->inputs_tensor_info(); in TEST_F()
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/
Dconfusion_mul_grad_fusion.cc33 CNodePtr CreateFusionNode(const FuncGraphPtr &graph, const CNodePtr &reduce_sum, const AnfNodePtr &… in CreateFusionNode() argument
36 MS_EXCEPTION_IF_NULL(reduce_sum); in CreateFusionNode()
46 fusion_node->set_scope(reduce_sum->scope()); in CreateFusionNode()
47 AnfAlgo::CopyNodeAttr(kAttrAxis, reduce_sum, fusion_node); in CreateFusionNode()
48 AnfAlgo::CopyNodeAttr(kAttrKeepDims, reduce_sum, fusion_node); in CreateFusionNode()
49 …types = {AnfAlgo::GetOutputInferDataType(mul0, 0), AnfAlgo::GetOutputInferDataType(reduce_sum, 0)}; in CreateFusionNode()
50 …auto shapes = {AnfAlgo::GetOutputInferShape(mul0, 0), AnfAlgo::GetOutputInferShape(reduce_sum, 0)}; in CreateFusionNode()
79 const AnfNodePtr &reduce_sum, const AnfNodePtr &input2) { in QuitFusion() argument
82 MS_EXCEPTION_IF_NULL(reduce_sum); in QuitFusion()
108 if (IsDepend(*graph, mul0->input(1), {reduce_sum})) { in QuitFusion()
[all …]
/third_party/mindspore/tests/st/model_zoo_tests/yolov3_darknet53/src/
Dloss.py25 self.reduce_sum = P.ReduceSum()
29 xy_loss = self.reduce_sum(xy_loss, ())
38 self.reduce_sum = P.ReduceSum()
42 wh_loss = self.reduce_sum(wh_loss, ())
51 self.reduce_sum = P.ReduceSum()
56 confidence_loss = self.reduce_sum(confidence_loss, ())
65 self.reduce_sum = P.ReduceSum()
69 class_loss = self.reduce_sum(class_loss, ())
/third_party/mindspore/tests/ut/cpp/python_input/gtest_input/pre_activate/
Dsoftmax_grad_ext_fusion.py46 reduce_sum = ReduceSum(mul, axes)
47 sub = Sub(input0, reduce_sum)
66 reduce_sum = ReduceSum(mul, axes)
67 sub = Sub(input0, reduce_sum)
86 reduce_sum = ReduceSum(mul, axes)
87 sub = Sub(input0, reduce_sum)
Dsquare_sum_fusion.py22 reduce_sum = P.ReduceSum() variable
46 res = reduce_sum(square_output, axis)
57 sum_output = reduce_sum(square_output, axis)
Dconfusion_softmax_grad_rule.py20 reduce_sum = P.ReduceSum(keep_dims=True) variable
47 res = reduce_sum(res, axis)
Dconfusion_mul_grad_fusion.py21 reduce_sum = P.ReduceSum() variable
49 output2 = reduce_sum(mul1, axis)
/third_party/mindspore/tests/ut/python/parallel/
Dtest_different_type_for_div_op.py49 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
53 out = self.reduce_sum(out, (0, 1))
72 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
76 out = self.reduce_sum(out, (0, 1))
95 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
99 out = self.reduce_sum(out, (0, 1))
Dtest_auto_parallel_reduce_method.py62 self.reduce_sum = P.ReduceSum(keep_dims=False)
67 out = self.reduce_sum(out, (0,))
86 self.reduce_sum = P.ReduceSum(keep_dims=False)
91 out = self.reduce_sum(out, (0, 1))
110 self.reduce_sum = P.ReduceSum(keep_dims=False)
115 out = self.reduce_sum(out, -1)
Dtest_reduce_method_info.py88 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy2)
93 out = self.reduce_sum(out, (1,))
115 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy2)
120 out = self.reduce_sum(out, (0, 1))
142 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy2)
147 out = self.reduce_sum(out, -1)
169 self.reduce_sum = P.ReduceSum(keep_dims=True).shard(strategy2)
174 out = self.reduce_sum(out, -1)
196 self.reduce_sum = P.ReduceSum(keep_dims=True).shard(strategy2)
200 out = self.reduce_sum(out, 0)
[all …]
Dtest_sum_as_loss.py49 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
53 out = self.reduce_sum(out, (0, 1))
72 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
76 out = self.reduce_sum(out, (0, 1))
Dtest_scalar_loss.py44 self.reduce_sum = P.ReduceSum(keep_dims=False).shard(strategy1)
49 out = self.reduce_sum(out, (0, 1))
Dtest_cus_matmul_dds.py52 self.reduce_sum = P.ReduceSum()
76 local_prob_reduce = self.reduce_sum(local_prob, 2)
77 global_prob_reduce = self.reduce_sum(global_prob, 2)
/third_party/mindspore/mindspore/nn/probability/zhusuan/framework/
Dbn.py35 self.reduce_sum = P.ReduceSum(keep_dims=True)
61 log_prob = self.reduce_sum(self.normal_dist(
82 log_prob = self.reduce_sum(
/third_party/mindspore/tests/st/control/
Dtest_ascend_control_sink.py161 self.reduce_sum = op.ReduceSum()
164 x_sum = self.reduce_sum(x)
165 y_sum = self.reduce_sum(y)
173 self.reduce_sum = op.ReduceSum()
176 x_sum = self.reduce_sum(x)
177 y_sum = self.reduce_sum(y)
185 self.reduce_sum = op.ReduceSum()
188 x_sum = self.reduce_sum(x)
/third_party/mindspore/tests/st/networks/models/deeplabv3/src/
Dlosses.py38 self.reduce_sum = P.ReduceSum(keep_dims=False)
53 loss = self.reduce_sum(weighted_losses, (0,))
57 present = self.reduce_sum(present, (0,))
/third_party/mindspore/mindspore/nn/loss/
Dloss.py65 self.reduce_sum = P.ReduceSum()
99 x = self.reduce_sum(x, self.get_axis(x))
640 intersection = self.reduce_sum(self.mul(logits.view(-1), label.view(-1)))
641 unionset = self.reduce_sum(self.mul(logits.view(-1), logits.view(-1))) + \
642 self.reduce_sum(self.mul(label.view(-1), label.view(-1)))
856 self.reduce_sum = P.ReduceSum()
888 return -self.reduce_sum(targets * self.log(pred + 1.0e-20), 1)
960 true_logits = self.reshape(self.reduce_sum(dots_as_matrix, 1), (-1, num_true))
1115 self.reduce_sum = P.ReduceSum()
1128 prod_sum = self.reduce_sum(logits_x1 * logits_x2, (1,))
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fission/
Ddynamic_rnn_grad_fission_v2.cc457 auto reduce_sum = func_graph->NewCNode(reduce_sum_inputs); in CreateDwReduceSum() local
460 … {AnfAlgo::GetOutputInferShape(dynamic_rnn_grad_cnode, 0)}, reduce_sum.get()); in CreateDwReduceSum()
462 AnfAlgo::SetNodeAttr(kAttrAxis, MakeValue(std::vector<int64_t>{0}), reduce_sum); in CreateDwReduceSum()
463 AnfAlgo::SetNodeAttr(kAttrKeepDims, MakeValue(false), reduce_sum); in CreateDwReduceSum()
464 AnfAlgo::SetNodeAttr("is_backend_insert", MakeValue(true), reduce_sum); in CreateDwReduceSum()
465 return reduce_sum; in CreateDwReduceSum()
507 auto reduce_sum = func_graph->NewCNode(reduce_sum_inputs); in CreateDbReduceSum() local
510 AnfAlgo::SetOutputInferTypeAndShape({kNumberTypeFloat16}, {out_shape}, reduce_sum.get()); in CreateDbReduceSum()
512 AnfAlgo::SetNodeAttr(kAttrAxis, MakeValue(std::vector<int64_t>{0}), reduce_sum); in CreateDbReduceSum()
513 AnfAlgo::SetNodeAttr(kAttrKeepDims, MakeValue(false), reduce_sum); in CreateDbReduceSum()
[all …]
/third_party/mindspore/tests/ut/python/dtype/
Dtest_list.py223 self.reduce_sum = P.ReduceSum()
231 ret_sum = self.reduce_sum(x, self.axis)
242 self.reduce_sum = P.ReduceSum()
246 return self.reduce_sum(x, self.axis)
252 self.reduce_sum = P.ReduceSum()
255 return self.reduce_sum(x)
/third_party/mindspore/mindspore/nn/probability/distribution/
Dcategorical.py153 self.reduce_sum = P.ReduceSum(keep_dims=True)
199 return self.reduce_sum(index * probs, -1)
215 return self.reduce_sum(self.square(index) * probs, -1) -\
216 self.square(self.reduce_sum(index * probs, -1))
227 return self.squeeze(-self.reduce_sum(logits * probs, -1))
244 return self.squeeze(self.reduce_sum(
/third_party/mindspore/tests/st/networks/models/bert/src/
Dbert_for_pre_training.py192 self.reduce_sum = P.ReduceSum()
206 … per_example_loss = self.neg(self.reduce_sum(prediction_scores * one_hot_labels, self.last_idx))
207 numerator = self.reduce_sum(label_weights * per_example_loss, ())
208 …denominator = self.reduce_sum(label_weights, ()) + self.cast(F.tuple_to_array((1e-5,)), mstype.flo…
214 per_example_loss = self.neg(self.reduce_sum(
371 self.reduce_sum = P.ReduceSum(keep_dims=False)
424 flag_sum = self.reduce_sum(init, (0,))
/third_party/mindspore/tests/ut/python/pipeline/parse/
Dtest_ms_function_pass_non_tensor_inputs.py50 reduce_sum = P.ReduceSum()
51 ret = reduce_sum(tensor_x, axis) + tensor_y
/third_party/mindspore/tests/st/networks/models/resnet50/src_thor/
Dmetric.py51 self.reduce_sum = P.ReduceSum()
60 y_correct = self.reduce_sum(y_correct)
/third_party/mindspore/tests/st/networks/models/resnet50/src/
Dmetric.py51 self.reduce_sum = P.ReduceSum()
60 y_correct = self.reduce_sum(y_correct)
/third_party/mindspore/tests/st/auto_monad/
Dtest_float_overflow.py41 self.reduce_sum = P.ReduceSum(keep_dims=True)
54 flag_sum = self.reduce_sum(init, (0,))

123