提交 84f990a0 编写于 作者: M Megvii Engine Team

fix(mge/tensor): fix `__repr__` for Tensor's subclass

GitOrigin-RevId: 91b58e6dcaacc40c3dac6d3689ed5f5a7a9be7dd
上级 cdbb4a20
......@@ -153,7 +153,7 @@ class Tensor(_Tensor, ArrayMethodMixin):
super()._reset(other)
def __repr__(self):
piece = "Tensor("
piece = "{}(".format(self.__class__.__name__)
with np.printoptions(precision=4, suppress=True):
piece += "{}".format(str(self.numpy()))
if self.dtype != np.float32:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册