提交 66d0847b 编写于 作者: H hong19860320 提交者: GitHub

[XPU] Fix cast op bridge (#2817)

上级 ea9e150d
...@@ -78,7 +78,11 @@ int CastConverter(void* ctx, OpLite* op, KernelBase* kernel) { ...@@ -78,7 +78,11 @@ int CastConverter(void* ctx, OpLite* op, KernelBase* kernel) {
if (graph->Has(x_name)) { if (graph->Has(x_name)) {
x_node = graph->Get(x_name); x_node = graph->Get(x_name);
} else { } else {
x_node = graph->Add(x_name, *x, in_ptype); CHECK(x->precision() == in_ptype)
<< "The data type of input tensor X should be "
<< PrecisionToStr(in_ptype) << ", but received "
<< PrecisionToStr(x->precision());
x_node = graph->Add(x_name, *x);
} }
// Cast node // Cast node
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册