MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / __repr__

Method __repr__

imperative/python/megengine/tensor.py:166–173  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 super()._reset(other)
165
166 def __repr__(self):
167 piece = "{}(".format(self.__class__.__name__)
168 with np.printoptions(precision=4, suppress=False):
169 piece += "{}".format(str(self.numpy()))
170 if self.dtype != np.float32:
171 piece += ", dtype={}".format(np.dtype(self.dtype).name)
172 piece += ", device={}".format(self.device) + ")"
173 return piece
174
175 @property
176 def name(self):

Callers 6

test_repr_basicFunction · 0.45
test_repr_module_deleteFunction · 0.45
test_reprFunction · 0.45

Calls 4

numpyMethod · 0.95
strFunction · 0.85
formatMethod · 0.45
dtypeMethod · 0.45

Tested by 6

test_repr_basicFunction · 0.36
test_repr_module_deleteFunction · 0.36
test_reprFunction · 0.36