MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __deepcopy__

Method __deepcopy__

deepspeed/linear/quantization.py:98–105  ·  view source on GitHub ↗
(self, memo)

Source from the content-addressed store, hash-verified

96 self.requires_grad = state["requires_grad"]
97
98 def __deepcopy__(self, memo):
99 new_instance = type(self).__new__(type(self))
100 state = self.__getstate__()
101 new_instance.__setstate__(state)
102 new_instance.quantizer = copy.deepcopy(state["quantizer"])
103 new_instance.quantization_config = copy.deepcopy(state["quantization_config"])
104 new_instance.data = copy.deepcopy(state["data"])
105 return new_instance
106
107 def __copy__(self):
108 new_instance = type(self).__new__(type(self))

Callers

nothing calls this directly

Calls 3

__getstate__Method · 0.95
__new__Method · 0.45
__setstate__Method · 0.45

Tested by

no test coverage detected