提交 4f122c07 编写于 作者: E emailweixu 提交者: Yi Wang

Remove incorrect statement in compare_op.h (#8416)

The type of tensor z should be bool. And there's no need to call mutable_data because ElementwiseComputeEx will do it.
上级 6752b06f
...@@ -67,7 +67,6 @@ class CompareOpKernel ...@@ -67,7 +67,6 @@ class CompareOpKernel
auto* x = context.Input<Tensor>("X"); auto* x = context.Input<Tensor>("X");
auto* y = context.Input<Tensor>("Y"); auto* y = context.Input<Tensor>("Y");
auto* z = context.Output<Tensor>("Out"); auto* z = context.Output<Tensor>("Out");
z->mutable_data<T>(context.GetPlace());
int axis = context.Attr<int>("axis"); int axis = context.Attr<int>("axis");
ElementwiseComputeEx<Functor, DeviceContext, T, bool>(context, x, y, axis, ElementwiseComputeEx<Functor, DeviceContext, T, bool>(context, x, y, axis,
Functor(), z); Functor(), z);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册