Browse Source

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

GitOrigin-RevId: 91b58e6dca
tags/v1.3.0
Megvii Engine Team 4 years ago
parent
commit
84f990a051
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      imperative/python/megengine/tensor.py

+ 1
- 1
imperative/python/megengine/tensor.py View File

@@ -153,7 +153,7 @@ class Tensor(_Tensor, ArrayMethodMixin):
super()._reset(other) super()._reset(other)


def __repr__(self): def __repr__(self):
piece = "Tensor("
piece = "{}(".format(self.__class__.__name__)
with np.printoptions(precision=4, suppress=True): with np.printoptions(precision=4, suppress=True):
piece += "{}".format(str(self.numpy())) piece += "{}".format(str(self.numpy()))
if self.dtype != np.float32: if self.dtype != np.float32:


Loading…
Cancel
Save