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

Method __deepcopy__

imperative/python/megengine/traced_module/expr.py:304–313  ·  view source on GitHub ↗
(self, memo)

Source from the content-addressed store, hash-verified

302 return result
303
304 def __deepcopy__(self, memo):
305 cls = self.__class__
306 result = cls.__new__(cls)
307 state = {}
308 memo[id(self)] = result
309 for k, v in self.__dict__.items():
310 if not isinstance(v, weakref.ReferenceType):
311 state[k] = copy.deepcopy(v, memo)
312 result.__dict__.update(state)
313 return result
314
315
316# expr: None (i.e. fake expression which is used to mark input)

Callers

nothing calls this directly

Calls 3

itemsMethod · 0.80
__new__Method · 0.45
updateMethod · 0.45

Tested by

no test coverage detected