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

Method __getnewargs__

imperative/python/megengine/tensor.py:226–236  ·  view source on GitHub ↗

r"""__getnewargs__ will be called for pickle serialization or deep copy

(self)

Source from the content-addressed store, hash-verified

224 return id(self)
225
226 def __getnewargs__(self):
227 r"""__getnewargs__ will be called for pickle serialization or deep copy"""
228 return (
229 self.numpy(),
230 self.dtype,
231 self.device.logical_name,
232 False,
233 False,
234 None,
235 self.format,
236 )
237
238 def __getstate__(self):
239 r"""__getstate__ will be called for pickle serialization or deep copy"""

Callers 2

test_serializationFunction · 0.95
test_compatibilityFunction · 0.80

Calls 1

numpyMethod · 0.95

Tested by 2

test_serializationFunction · 0.76
test_compatibilityFunction · 0.64