!46036 GraphKernel Fix CSE BUG

Merge pull request !46036 from ZengZitao/fix_some_bugs
This commit is contained in:
i-robot 2022-11-26 00:45:29 +00:00 committed by Gitee
commit afbae413e8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,8 @@ class COMMON_EXPORT CallbackImpl : public Callback {
void SetBasicNodeKernelInfo(const AnfNodePtr &node, const std::vector<inner::NodeBase> &outputs_info) override;
void SetEmptyKernelInfo(const AnfNodePtr &node) override;
void ResetKernelInfo(const AnfNodePtr &node) override;
private:
void CollectInputTypesAndFormats(const AnfNodePtr &node, std::vector<TypeId> *input_types,
std::vector<std::string> *input_formats);
};

View File

@ -57,6 +57,7 @@ void InsertReshape(const FuncGraphPtr &graph, const AnfNodePtr &node, const Type
MS_EXCEPTION_IF_NULL(reshape);
common::AnfAlgo::SetNodeAttr(kAttrShape, MakeValue(infer_shape), reshape);
common::AnfAlgo::SetOutputInferTypeAndShape({infer_type}, {infer_shape}, reshape.get());
reshape->set_kernel_info(std::make_shared<device::KernelInfo>());
auto graph_sel_info =
BuildSelectKernelBuildInfo({kOpFormat_DEFAULT}, {device_type}, {kOpFormat_DEFAULT}, {device_type});
AnfAlgo::SetSelectKernelBuildInfo(graph_sel_info, reshape.get());