Home
last modified time | relevance | path

Searched refs:cast_node (Results 1 – 12 of 12) sorted by relevance

/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/format_type/
Dconvert_cast_format.cc52 auto cast_node = input_node->cast<CNodePtr>(); in Process() local
53 MS_EXCEPTION_IF_NULL(cast_node); in Process()
54 ChangeCastFormat(cast_node, func_graph); in Process()
59 void ConvertCastFormat::SetCastFormat(const CNodePtr &cast_node, const string &format) const { in SetCastFormat() argument
60 MS_EXCEPTION_IF_NULL(cast_node); in SetCastFormat()
62 …red<kernel::KernelBuildInfo::KernelBuildInfoBuilder>(AnfAlgo::GetSelectKernelBuildInfo(cast_node)); in SetCastFormat()
66 AnfAlgo::SetSelectKernelBuildInfo(info_builder->Build(), cast_node.get()); in SetCastFormat()
69 void ConvertCastFormat::ChangeCastFormat(const CNodePtr &cast_node, const FuncGraphPtr &func_graph)… in ChangeCastFormat() argument
70 MS_EXCEPTION_IF_NULL(cast_node); in ChangeCastFormat()
72 auto input_node_name = AnfAlgo::GetCNodeName(cast_node); in ChangeCastFormat()
[all …]
Dconvert_cast_format.h39 const CNodePtr &cast_node) const;
40 void ChangeCastFormat(const CNodePtr &cast_node, const FuncGraphPtr &func_graph) const;
41 void SetCastFormat(const CNodePtr &cast_node, const string &format) const;
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/graph_kernel/
Dcast_matmul_fusion.cc27 void UpdateBuildInfo(const AnfNodePtr &matmul_node, const AnfNodePtr &cast_node) { in UpdateBuildInfo() argument
31 auto cast_types = AnfAlgo::GetAllInputDeviceTypes(cast_node); in UpdateBuildInfo()
66 auto cast_node = cnode->inputs().back(); // bias node in DoFuse() local
67 if (!IsPrimitiveCNode(cast_node, prim::kPrimCast)) { in DoFuse()
70 auto cast_input_type = AnfAlgo::GetInputDeviceDataType(cast_node, 0); in DoFuse()
71 auto cast_output_type = AnfAlgo::GetOutputDeviceDataType(cast_node, 0); in DoFuse()
77 auto iter = std::find(params.begin(), params.end(), (cast_node->cast<CNodePtr>())->input(1)); in DoFuse()
82 auto user_index_set = mng->node_users()[cast_node]; in DoFuse()
84 (void)mng->Replace(cast_node, (cast_node->cast<CNodePtr>())->input(1)); in DoFuse()
85 UpdateBuildInfo(cnode, cast_node); in DoFuse()
Dreorder_ops.cc275 auto cast_node = node_input->cast<CNodePtr>(); in ReorderCastUpTypeInsensitive() local
276 …if (cast_node != nullptr && IsPrimitiveCNode(cast_node, prim::kPrimCast) && GetCastType(cast_node)… in ReorderCastUpTypeInsensitive()
278 mng->node_users()[cast_node].size() == 1) { in ReorderCastUpTypeInsensitive()
279 cast_nodes.push_back(cast_node); in ReorderCastUpTypeInsensitive()
280 cast_input_nodes.push_back(AnfAlgo::GetInputNode(cast_node, 0)); in ReorderCastUpTypeInsensitive()
292 …if (!std::all_of(cast_nodes.begin(), cast_nodes.end(), [&small_type](const AnfNodePtr &cast_node) { in ReorderCastUpTypeInsensitive() argument
293 return AnfAlgo::GetInputDeviceDataType(cast_node, 0) == small_type; in ReorderCastUpTypeInsensitive()
Draise_reduction_precision.cc61 …ReductionPrecision::ReplaceNode(const AnfNodePtr &reduce_node, const AnfNodePtr &cast_node) const { in ReplaceNode()
76 user_node->cast<CNodePtr>()->set_input(user_index, cast_node); in ReplaceNode()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/gpu/
Dcombine_cast_fusion.cc32 for (auto &cast_node : node_list) { in GetDealList() local
33 MS_EXCEPTION_IF_NULL(cast_node); in GetDealList()
36 if (!IsPrimitiveCNode(cast_node, prim::kPrimCast)) { in GetDealList()
39 auto input0 = AnfAlgo::GetInputNode(utils::cast<CNodePtr>(cast_node), 0); in GetDealList()
42 auto dst = AnfAlgo::GetOutputInferDataType(cast_node, 0); in GetDealList()
43 auto src = AnfAlgo::GetPrevNodeOutputInferDataType(cast_node, 0); in GetDealList()
45 cast_32to16_list.push_back(cast_node); in GetDealList()
55 cast_16to32_list.push_back(cast_node); in GetDealList()
Dapply_momentum_weight_scale_fusion.cc78 auto cast_node = node->cast<CNodePtr>()->input(kInputIndex); in GetCastInput() local
79 if (IsPrimitiveCNode(cast_node, prim::kPrimCast)) { in GetCastInput()
80 return cast_node->cast<CNodePtr>()->input(kInputIndex); in GetCastInput()
/third_party/mindspore/mindspore/ccsrc/runtime/device/ascend/
Dkernel_select_ascend.cc410 auto cast_node = input_node->cast<CNodePtr>(); in RefreshCastAndParamWeightFormat() local
411 MS_EXCEPTION_IF_NULL(cast_node); in RefreshCastAndParamWeightFormat()
412 if (AnfAlgo::GetCNodeName(cast_node) != prim::kPrimCast->name()) { in RefreshCastAndParamWeightFormat()
415 if (AnfAlgo::IsFeatureMapOutput(cast_node)) { in RefreshCastAndParamWeightFormat()
426 AnfAlgo::SetSelectKernelBuildInfo(info_builder->Build(), cast_node.get()); in RefreshCastAndParamWeightFormat()
427 auto cast_input_node = AnfAlgo::VisitKernel(AnfAlgo::GetInputNode(cast_node, 0), 0); in RefreshCastAndParamWeightFormat()
428 SetWeightFormat(cast_input_node.first, {format}, cast_node, 0, true); in RefreshCastAndParamWeightFormat()
/third_party/mindspore/mindspore/lite/tools/optimizer/graph/
Dunused_cast_node_remove_pass.cc41 MS_ASSERT(cast_node != nullptr); in Run()
/third_party/mindspore/mindspore/ccsrc/frontend/operator/composite/
Ddo_signature.cc195 auto cast_node = NewCNode({NewValueNode(prim_cast_class)}, graph); in DoCast() local
196 return graph->NewCNodeAfter(param, {cast_node, param, dtype_node}); in DoCast()
/third_party/mindspore/tests/ut/cpp/optimizer/
Dlib_test.cc177 auto cast_node = inputs[0]; in TEST_F() local
178 auto cast_py = cast_node->cast<ValueNodePtr>()->value()->cast<PrimitivePyPtr>(); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/
Dstep_parallel.cc1539 CNodePtr cast_node = InsertAllGatherAfterCast(cnode); in InsertAllGatherOp() local
1540 if (!is_shared_param && cast_node) { in InsertAllGatherOp()
1541 …allgather = ReplaceNode(op, cast_node, graph, PARALLEL_OPTIMIZER_ALLGATHER_NOT_COMPUTE, param_name… in InsertAllGatherOp()