提交 9794b13c 编写于 作者: H hexia

fix switch input

上级 84cdb9f4
...@@ -562,10 +562,17 @@ KernelSelectStatus SelectKernelInfo(const CNodePtr &kernel_node, KernelType kern ...@@ -562,10 +562,17 @@ KernelSelectStatus SelectKernelInfo(const CNodePtr &kernel_node, KernelType kern
MS_LOG(WARNING) << "kernel [" << (kernel_info_list.size() + index) MS_LOG(WARNING) << "kernel [" << (kernel_info_list.size() + index)
<< "] :" << aicpu_kernel_info_list[index]->ToString(); << "] :" << aicpu_kernel_info_list[index]->ToString();
} }
MS_LOG(WARNING) << " <<<"; if (IsPrimitiveCNode(kernel_node, prim::kPrimLabelSwitch)) {
MS_EXCEPTION(TypeError) << "The node [" << kernel_node->DebugString() auto selected_kernel_info = ChooseMatchedKernelInfo(kernel_node, kernel_info_list);
<< "] cannot find valid kernel info, not supported the type:" << buffer.str() AnfAlgo::SetSelectKernelBuildInfo(selected_kernel_info, kernel_node.get());
<< ", please refer to the supported dtypes in candidates kernel info list"; // Set format and data type for input tensor.
SetTensorDeviceInfo(*selected_kernel_info, kernel_node);
} else {
MS_LOG(WARNING) << " <<<";
MS_EXCEPTION(TypeError) << "The node [" << kernel_node->DebugString()
<< "] cannot find valid kernel info, not supported the type:" << buffer.str()
<< ", please refer to the supported dtypes in candidates kernel info list";
}
} }
return select_status; return select_status;
} }
......
...@@ -75,8 +75,8 @@ std::vector<TaskInfoPtr> LabelSwitchKernel::GenTask(const std::vector<AddressPtr ...@@ -75,8 +75,8 @@ std::vector<TaskInfoPtr> LabelSwitchKernel::GenTask(const std::vector<AddressPtr
std::vector<std::shared_ptr<kernel::KernelBuildInfo>> LabelSwitchDesc::GetKernelInfo() { std::vector<std::shared_ptr<kernel::KernelBuildInfo>> LabelSwitchDesc::GetKernelInfo() {
std::vector<std::shared_ptr<kernel::KernelBuildInfo>> label_switch_build_info{}; std::vector<std::shared_ptr<kernel::KernelBuildInfo>> label_switch_build_info{};
vector<string> input_format{kOpFormat_DEFAULT, kOpFormat_DEFAULT}; vector<string> input_format{kOpFormat_DEFAULT};
vector<TypeId> input_type{kNumberTypeUInt32, kNumberTypeBool}; vector<TypeId> input_type{kNumberTypeInt32};
if (input_format.size() != input_type.size()) { if (input_format.size() != input_type.size()) {
MS_LOG(EXCEPTION) << "Invalid param num, input_format size " << input_format.size() << " input_type size " MS_LOG(EXCEPTION) << "Invalid param num, input_format size " << input_format.size() << " input_type size "
<< input_type.size(); << input_type.size();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册