未验证 提交 496aadfb 编写于 作者: S ShiningZhang 提交者: GitHub

fix bug: core when missing range XPU kernel in kunlun2 (#39673)

上级 e16ab42b
......@@ -71,6 +71,10 @@ class RangeOp : public framework::OperatorWithKernel {
framework::OpKernelType GetKernelTypeForVar(
const std::string &var_name, const framework::Tensor &tensor,
const framework::OpKernelType &expected_kernel_type) const override {
if (platform::is_xpu_place(tensor.place())) {
return framework::OpKernelType(expected_kernel_type.data_type_,
tensor.place(), tensor.layout());
}
return expected_kernel_type;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册