/third_party/mindspore/mindspore/lite/tools/converter/parser/onnx/ |
D | onnx_pad_adjust.cc | 57 CNodePtr NewReshapeOpNode(const FuncGraphPtr &func_graph, const AnfNodePtr &input_node, const std::… in NewReshapeOpNode() argument 59 MS_ASSERT(input_node != nullptr); in NewReshapeOpNode() 70 new_parameter->set_name(input_node->fullname_with_scope() + "_reshape/shape"); in NewReshapeOpNode() 71 std::vector<AnfNodePtr> op_inputs = {value_node, input_node, new_parameter}; in NewReshapeOpNode() 74 reshape->set_fullname_with_scope(input_node->fullname_with_scope() + "_reshape"); in NewReshapeOpNode() 78 CNodePtr NewTransposeOpNode(const FuncGraphPtr &func_graph, const AnfNodePtr &input_node, in NewTransposeOpNode() argument 81 MS_ASSERT(input_node != nullptr); in NewTransposeOpNode() 92 new_parameter->set_name(input_node->fullname_with_scope() + "_transpose/perm"); in NewTransposeOpNode() 93 std::vector<AnfNodePtr> op_inputs = {value_node, input_node, new_parameter}; in NewTransposeOpNode() 96 reshape->set_fullname_with_scope(input_node->fullname_with_scope() + "_transpose"); in NewTransposeOpNode() [all …]
|
/third_party/mindspore/mindspore/ccsrc/runtime/framework/actor/ |
D | data_prepare_actor.cc | 210 const auto &input_node = input_nodes[j]; in PrepareDataForDeviceTensorStore() local 212 MS_EXCEPTION_IF_NULL(input_node); in PrepareDataForDeviceTensorStore() 213 if (!IsPersistentDeviceTensor(input_node)) { in PrepareDataForDeviceTensorStore() 216 const auto front_node = FetchFrontNodeByBackendNode(input_node, graph); in PrepareDataForDeviceTensorStore() 217 PrepareDataForWeightNode(input_node, front_node, input_tensor, device_context, context); in PrepareDataForDeviceTensorStore() 241 const auto &input_node = input_nodes[j]; in PrepareDataForHostTensorQueue() local 243 MS_EXCEPTION_IF_NULL(input_node); in PrepareDataForHostTensorQueue() 244 …if (!IsHostQueueDSActor(input_node, graph, graph_compiler_info_->origin_parameters_order_, strateg… in PrepareDataForHostTensorQueue() 247 auto tensor_position = host_data_source_actor_->FetchNodePosition(input_node); in PrepareDataForHostTensorQueue() 255 auto device_address = AnfAlgo::GetMutableOutputAddr(input_node, 0, false); in PrepareDataForHostTensorQueue() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/gpu/ |
D | remove_format_transform_pair.cc | 41 auto input_node = AnfAlgo::GetInputNode(utils::cast<CNodePtr>(node), 0); in Process() local 42 MS_EXCEPTION_IF_NULL(input_node); in Process() 44 AnfAlgo::GetCNodeName(input_node) != prim::kPrimTranspose->name()) { in Process() 46 … << "node:" << AnfAlgo::GetCNodeName(node) << " node input:" << AnfAlgo::GetCNodeName(input_node); in Process() 49 if (IsUsedByOthers(graph, input_node)) { in Process() 50 MS_LOG(DEBUG) << "The transpose node [" << input_node->fullname_with_scope() in Process() 54 auto transpose1_input_shape = AnfAlgo::GetInputDeviceShape(input_node, 0); in Process() 57 auto transpose1_input_node = AnfAlgo::GetInputNode(utils::cast<CNodePtr>(input_node), 0); in Process()
|
D | remove_redundant_format_transform.cc | 39 auto input_node = AnfAlgo::GetInputNode(utils::cast<CNodePtr>(node), 0); in Process() local 40 MS_EXCEPTION_IF_NULL(input_node); in Process() 42 auto used_node_list = GetRealNodeUsedList(graph, input_node); in Process()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/trt_pass/ |
D | graph_partitioner.cc | 140 auto input_node = AnfAlgo::GetInputNode(node->cast<CNodePtr>(), input_index); in ExistCycleAfterMerge() local 141 …if (input_node == nullptr || input_node->isa<ValueNode>() || input_node->isa<Parameter>()) continu… in ExistCycleAfterMerge() 143 if (node_info_[input_node].graph_id() == target_graph_id) { in ExistCycleAfterMerge() 147 if (dependency_.ExistDependency(node_info_[input_node].graph_id(), target_graph_id)) { in ExistCycleAfterMerge() 164 auto input_node = AnfAlgo::GetInputNode(node->cast<CNodePtr>(), input_index); in MergeParentBranchRecursively() local 165 …if (input_node == nullptr || input_node->isa<ValueNode>() || input_node->isa<Parameter>()) continu… in MergeParentBranchRecursively() 167 if (node_info_[input_node].graph_id() == old_graph_id) { in MergeParentBranchRecursively() 168 MergeParentBranchRecursively(input_node, old_graph_id, new_graph_id); in MergeParentBranchRecursively() 193 auto input_node = AnfAlgo::GetInputNode(node->cast<CNodePtr>(), input_index); in NodeGrouping() local 194 …if (input_node == nullptr || input_node->isa<ValueNode>() || input_node->isa<Parameter>()) continu… in NodeGrouping() [all …]
|
D | trt_converter_context.cc | 100 for (auto input_node : graph_inputs) { in InitInputTable() local 101 if (!input_node->isa<Parameter>()) { in InitInputTable() 105 auto input = input_node->cast<ParameterPtr>(); in InitInputTable() 118 output_map_[input_node][0] = LayerInput(weight, tensor->shape()); in InitInputTable() 223 for (const auto &input_node : func_graph_->parameters()) { in GetGraphInputs() local 224 if (!input_node->isa<Parameter>()) { in GetGraphInputs() 228 auto input = input_node->cast<ParameterPtr>(); in GetGraphInputs() 230 graph_inputs.insert(std::make_pair(input->name(), input_node)); in GetGraphInputs()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/pass/ |
D | convert_const_input_to_tensor_input.cc | 31 AnfNodePtr CreateTensorInput(const KernelGraphPtr &kernel_graph, const AnfNodePtr &input_node) { in CreateTensorInput() argument 32 MS_EXCEPTION_IF_NULL(input_node); in CreateTensorInput() 33 auto value_node = input_node->cast<ValueNodePtr>(); in CreateTensorInput() 58 tensor_input->set_scope(input_node->scope()); in CreateTensorInput() 77 auto input_node = inputs[i + 1]; in ConstInputToTensorInput() local 78 if (IsValueNode<Scalar>(input_node) || IsValueNode<ValueTuple>(input_node)) { in ConstInputToTensorInput() 79 auto tensor_input = CreateTensorInput(kernel_graph, input_node); in ConstInputToTensorInput() 81 new_inputs.push_back(input_node); in ConstInputToTensorInput() 87 new_inputs.push_back(input_node); in ConstInputToTensorInput()
|
D | convert_const_scalar_to_tensor.cc | 27 AnfNodePtr CreateTensorInput(const KernelGraphPtr &kernel_graph, const AnfNodePtr &input_node) { in CreateTensorInput() argument 28 MS_EXCEPTION_IF_NULL(input_node); in CreateTensorInput() 29 if (!input_node->isa<ValueNode>()) { in CreateTensorInput() 32 auto value_node = input_node->cast<ValueNodePtr>(); in CreateTensorInput() 41 MS_LOG(WARNING) << "Create tensor of" << input_node->DebugString() << "failed"; in CreateTensorInput() 53 tensor_input->set_scope(input_node->scope()); in CreateTensorInput()
|
D | convert_tuple_input_to_dynamic_input.cc | 71 auto input_node = AnfAlgo::GetInputNode(cnode_ptr, i); in ConvertMakeTupleInputToPlantInputs() local 72 MS_EXCEPTION_IF_NULL(input_node); in ConvertMakeTupleInputToPlantInputs() 73 if (AnfAlgo::IsTupleOutput(input_node)) { in ConvertMakeTupleInputToPlantInputs() 74 (void)dyn_input_sizes.emplace_back(SplitTupleInputs(graph, input_node, &plant_inputs)); in ConvertMakeTupleInputToPlantInputs() 77 plant_inputs.push_back(input_node); in ConvertMakeTupleInputToPlantInputs()
|
/third_party/mindspore/mindspore/lite/tools/converter/quantizer/ |
D | quant_cast.cc | 49 auto input_node = cnode->input(input_index); in InsertCastNode() local 53 auto input_cnode = std::dynamic_pointer_cast<mindspore::CNode>(input_node); in InsertCastNode() 101 std::vector<AnfNodePtr> op_inputs = {value_node, input_node}; in InsertCastNode() 110 STATUS CheckDataType(const AnfNodePtr &input_node, bool is_graph_input) { in CheckDataType() argument 111 if (!input_node->isa<mindspore::CNode>() && !is_graph_input) { in CheckDataType() 115 …input_node->isa<mindspore::CNode>() && opt::IsSpecialType(input_node->cast<mindspore::CNodePtr>()); in CheckDataType() 118 auto ret = opt::GetDataTypeFromAnfNode(input_node, &type_id); in CheckDataType() 135 auto input_node = cnode->input(i); in Run() local 136 …auto is_graph_input = input_node->isa<Parameter>() && !input_node->cast<ParameterPtr>()->has_defau… in Run() 137 auto ret = CheckDataType(input_node, is_graph_input); in Run()
|
/third_party/mindspore/mindspore/ccsrc/runtime/device/executor/ |
D | dynamic_kernel.cc | 101 auto input_node = input_node_with_index.first; in InferShapeRecursive() local 102 MS_EXCEPTION_IF_NULL(input_node); in InferShapeRecursive() 103 InferShapeForNopNode(&input_node); in InferShapeRecursive() 107 void DynamicKernel::InferShapeForNopNode(AnfNodePtr *input_node) { in InferShapeForNopNode() argument 108 MS_EXCEPTION_IF_NULL(*input_node); in InferShapeForNopNode() 109 if (!opt::IsNopNode(*input_node) || !AnfAlgo::IsDynamicShape(*input_node)) { in InferShapeForNopNode() 115 nop_road.push(*input_node); in InferShapeForNopNode() 119 auto input_node_with_idx = AnfAlgo::GetPrevNodeOutput(*input_node, 0); in InferShapeForNopNode() 124 *input_node = in_node; in InferShapeForNopNode()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/ |
D | conv1d_inout_adjust.cc | 35 … Conv1DInOutAdjust::NewUnsqueezeOpNode(const FuncGraphPtr &func_graph, const AnfNodePtr input_node, in NewUnsqueezeOpNode() argument 38 MS_CHECK_TRUE_MSG(input_node != nullptr, nullptr, "input_node is nullptr"); in NewUnsqueezeOpNode() 45 std::vector<AnfNodePtr> op_inputs = {value_node, input_node}; in NewUnsqueezeOpNode() 48 unsqueeze->set_fullname_with_scope(input_node->fullname_with_scope() + "_unsqueeze"); in NewUnsqueezeOpNode() 52 …tr Conv1DInOutAdjust::NewSqueezeOpNode(const FuncGraphPtr &func_graph, const AnfNodePtr input_node, in NewSqueezeOpNode() argument 59 std::vector<AnfNodePtr> op_inputs = {value_node, input_node}; in NewSqueezeOpNode() 62 squeeze->set_fullname_with_scope(input_node->fullname_with_scope() + "_squeeze"); in NewSqueezeOpNode() 128 auto input_node = cnode->input(1); in Run() local 129 auto unsqueeze = NewUnsqueezeOpNode(func_graph, input_node, axis); in Run() 131 (void)manager->Replace(input_node, unsqueeze); in Run() [all …]
|
/third_party/mindspore/mindspore/lite/tools/optimizer/fusion/ |
D | constant_folding_fusion.cc | 218 …eplaceCNode(const FuncGraphPtr &func_graph, const CNodePtr &any_node, const AnfNodePtr &input_node, in ReplaceCNode() argument 225 auto used_node_list = GetRealNodeUsedListByOutputIdx(func_graph, input_node, k); in ReplaceCNode() 238 MS_LOG(ERROR) << "CreateNewParamter failed, name: " << input_node->fullname_with_scope(); in ReplaceCNode() 241 new_parameter->set_name(input_node->fullname_with_scope() + "_const_" + std::to_string(k)); in ReplaceCNode() 244 …MS_LOG(ERROR) << " multi out tensor must connect tuple-getitem: " << input_node->fullname_with_sco… in ReplaceCNode() 251 MS_LOG(ERROR) << "CreateNewParamter failed, name: " << input_node->fullname_with_scope(); in ReplaceCNode() 254 new_parameter->set_name("constfold_" + input_node->fullname_with_scope()); in ReplaceCNode() 255 (void)manager->Replace(input_node, new_parameter); in ReplaceCNode() 317 bool ConstFoldPass::CheckCanFusion(const AnfNodePtr &input_node) const { in CheckCanFusion() 318 if (!input_node->isa<CNode>() || !CheckIsAllInputsParam(input_node)) { in CheckCanFusion() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ |
D | ascend_helper.cc | 41 AnfNodePtr CreateReshapeNode(const FuncGraphPtr &func_graph, const AnfNodePtr &input_node, in CreateReshapeNode() argument 46 trans_inputs.emplace_back(input_node); in CreateReshapeNode() 49 …AnfAlgo::SetOutputInferTypeAndShape({AnfAlgo::GetOutputInferDataType(input_node, 0)}, {dst_shape},… in CreateReshapeNode() 52 reshape->set_scope(input_node->scope()); in CreateReshapeNode() 112 auto input_node = AnfAlgo::GetInputNode(node, index); in GetTransInputNodePtr() local 113 if (HasAbstractMonad(input_node)) { in GetTransInputNodePtr() 115 return input_node; in GetTransInputNodePtr() 117 auto node_with_index = AnfAlgo::VisitKernel(input_node, 0); in GetTransInputNodePtr() 121 input_node = InsertTransOpForOutput(func_graph, input_node, input_node, kernel_select); in GetTransInputNodePtr() 122 MS_EXCEPTION_IF_NULL(input_node); in GetTransInputNodePtr() [all …]
|
/third_party/mindspore/mindspore/lite/tools/optimizer/fisson/ |
D | iter_node_outputs.cc | 32 for (const auto &input_node : inputs) { in Run() local 33 MS_ASSERT(input_node != nullptr); in Run() 34 if (!utils::isa<CNodePtr>(input_node)) { in Run() 37 auto input_cnode = input_node->cast<CNodePtr>(); in Run()
|
D | node_out_shapes.cc | 34 for (const auto &input_node : cnode->inputs()) { in Run() local 35 MS_ASSERT(input_node != nullptr); in Run() 36 if (utils::isa<CNodePtr>(input_node) || utils::isa<ParameterPtr>(input_node)) { in Run() 37 auto in_shape = input_node->Shape(); in Run()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/format_type/ |
D | remove_internal_output.cc | 73 auto input_node = cnode->input(1); in Process() local 74 if (!AnfAlgo::CheckPrimitiveType(input_node, prim::kPrimTupleGetItem)) { in Process() 75 kernel_graph->ReplaceInternalOutput(node, input_node); in Process() 77 auto tuple_getitem = input_node->cast<CNodePtr>(); in Process() 83 return input_node; in Process()
|
D | dynamic_rnn_grad_reformat.cc | 40 auto input_node = input_node_with_idx.first; in Process() local 41 MS_EXCEPTION_IF_NULL(input_node); in Process() 42 if (!(input_node->isa<CNode>() && in Process() 43 AnfAlgo::GetCNodeName(input_node->cast<CNodePtr>()) == kBasicLSTMCellCStateGradV2OpName)) { in Process()
|
/third_party/mindspore/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/ |
D | graph_desc_reporter.cc | 37 auto input_node = input_node_with_index.first; in ReportData() local 41 element.data_type_ = AnfAlgo::GetOutputDeviceDataType(input_node, input_index); in ReportData() 42 element.data_format_ = AnfAlgo::GetOutputFormat(input_node, input_index); in ReportData() 43 element.data_shape_ = AnfAlgo::GetOutputDeviceShape(input_node, input_index); in ReportData()
|
/third_party/mindspore/mindspore/ccsrc/frontend/optimizer/ad/ |
D | pynative_dfunctor.cc | 179 const auto &input_node = cnode_morph->input(i + 1); in RunInputReplace() local 180 MS_EXCEPTION_IF_NULL(input_node); in RunInputReplace() 182 if (input_node->isa<Parameter>() || input_node->isa<ValueNode>() || in RunInputReplace() 183 IsPrimitiveCNode(input_node, prim::kPrimStopGradient)) { in RunInputReplace() 188 CNodePtr cnode_i = input_node->cast<CNodePtr>(); in RunInputReplace() 196 if (para_ref_size > 0 && !IsPrimitiveCNode(input_node, prim::kPrimUpdateState)) { in RunInputReplace()
|
/third_party/mindspore/mindspore/lite/tools/converter/parser/tf/ |
D | functionalize_while.cc | 65 for (auto &input_node : node->inputs()) { in BlongToWhichExternalEnter() local 66 …if (FunctionalizeControlOpPass::IsEnter(input_node) && WhileNodeExternalInputIsContain(input_node)… in BlongToWhichExternalEnter() 67 aim_node = utils::cast<CNodePtr>(input_node); in BlongToWhichExternalEnter() 71 todo.push_back(input_node); in BlongToWhichExternalEnter() 335 for (auto &input_node : cnode->inputs()) { in IdentifyCondSubgraphInput() local 336 if (FunctionalizeControlOpPass::IsMerge(input_node)) { in IdentifyCondSubgraphInput() 337 CHECK_NULL_RETURN(input_node); in IdentifyCondSubgraphInput() 338 auto merge_node = input_node->cast<CNodePtr>(); in IdentifyCondSubgraphInput() 470 for (auto &input_node : cnode->inputs()) { in IdentifyBodySubgraphInput() local 471 if (FunctionalizeControlOpPass::IsSwitch(input_node)) { in IdentifyBodySubgraphInput() [all …]
|
/third_party/mindspore/mindspore/ccsrc/runtime/device/cpu/ |
D | kernel_select_cpu.cc | 37 auto input_node = AnfAlgo::VisitKernel(kernel_node->input(input_index + 1), 0).first; in IsInputNotCNode() local 38 MS_EXCEPTION_IF_NULL(input_node); in IsInputNotCNode() 39 if (input_node->isa<Parameter>() || input_node->isa<ValueNode>()) { in IsInputNotCNode() 48 auto input_node = AnfAlgo::VisitKernel(kernel_node->input(input_index + 1), 0).first; in UpdatePrevNotCNodeFormatDtype() local 49 MS_EXCEPTION_IF_NULL(input_node); in UpdatePrevNotCNodeFormatDtype() 50 …if (input_node->isa<Parameter>() && AnfAlgo::IsParameterWeight(input_node->cast<ParameterPtr>())) { in UpdatePrevNotCNodeFormatDtype() 51 MS_EXCEPTION_IF_NULL(input_node); in UpdatePrevNotCNodeFormatDtype() 58 AnfAlgo::SetSelectKernelBuildInfo(builder->Build(), input_node.get()); in UpdatePrevNotCNodeFormatDtype()
|
/third_party/mindspore/mindspore/ccsrc/runtime/framework/ |
D | graph_scheduler.cc | 106 for (const auto &input_node : graph->input_nodes()) { in ClearNodeInfo() local 107 MS_EXCEPTION_IF_NULL(input_node); in ClearNodeInfo() 108 if (!input_node->isa<Parameter>()) { in ClearNodeInfo() 111 auto parameter = input_node->cast<ParameterPtr>(); in ClearNodeInfo() 118 auto front_input_node = FetchFrontNodeByBackendNode(input_node, graph); in ClearNodeInfo() 120 size_t output_num = AnfAlgo::GetOutputTensorNum(input_node); in ClearNodeInfo() 122 if (AnfAlgo::OutputAddrExist(input_node, index)) { in ClearNodeInfo() 123 AnfAlgo::SetOutputAddr(nullptr, index, input_node.get()); in ClearNodeInfo() 456 auto input_node = AnfAlgo::GetInputNode(kernel, i); in Link() local 458 if (AnfAlgo::IsOneOfPrimitiveCNode(input_node, auto_monad_prims)) { in Link() [all …]
|
/third_party/mindspore/mindspore/ccsrc/runtime/device/ |
D | kernel_runtime.cc | 59 auto input_node = kernel->input(i + 1); in GetGraphInputs() local 60 auto input_real_node = AnfAlgo::VisitKernelWithReturnType(input_node, 0).first; in GetGraphInputs() 124 auto input_node = input_node_with_index.first; in RunOpGetCommunicationInputInfo() local 125 MS_EXCEPTION_IF_NULL(input_node); in RunOpGetCommunicationInputInfo() 127 if (AnfAlgo::OutputAddrExist(input_node, input_node_with_index.second)) { in RunOpGetCommunicationInputInfo() 128 address = AnfAlgo::GetMutableOutputAddr(input_node, input_node_with_index.second); in RunOpGetCommunicationInputInfo() 130 if (input_node->isa<CNode>()) { in RunOpGetCommunicationInputInfo() 131 address = PreAssignCNodeMemory(input_node, input_node_with_index.second); in RunOpGetCommunicationInputInfo() 285 auto &input_node = kernel_with_index.first; in ResetNodeAddress() local 286 if (NodeOutputDeviceAddressExist(input_node, index)) { in ResetNodeAddress() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/session/ |
D | gpu_session.cc | 299 size_t UpdateGraphInputAbstract(const AnfNodePtr input_node, const tensor::TensorPtr tensor) { in UpdateGraphInputAbstract() argument 300 MS_EXCEPTION_IF_NULL(input_node); in UpdateGraphInputAbstract() 303 if (!input_node->isa<Parameter>()) { in UpdateGraphInputAbstract() 306 auto input_param = input_node->cast<ParameterPtr>(); in UpdateGraphInputAbstract() 311 … AnfAlgo::SetOutputInferTypeAndShape({AnfAlgo::GetOutputInferDataType(input_node, 0)}, {shape_tmp}, in UpdateGraphInputAbstract() 312 input_node.get()); in UpdateGraphInputAbstract() 332 auto input_node = input_nodes[i]; in LoadInputData() local 333 MS_EXCEPTION_IF_NULL(input_node); in LoadInputData() 334 if (input_node->isa<Parameter>() && AnfAlgo::OutputAddrExist(input_node, 0)) { in LoadInputData() 336 const std::string ¶m_name = input_node->fullname_with_scope(); in LoadInputData() [all …]
|