MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / __deepcopy__

Method __deepcopy__

bitsandbytes/nn/modules.py:759–769  ·  view source on GitHub ↗
(self, memo)

Source from the content-addressed store, hash-verified

757 return self.to(device="xpu" if device is None else device, non_blocking=non_blocking)
758
759 def __deepcopy__(self, memo):
760 # adjust this if new arguments are added to the constructor
761 new_instance = type(self).__new__(
762 type(self),
763 data=copy.deepcopy(self.data, memo),
764 requires_grad=self.requires_grad,
765 has_fp16_weights=self.has_fp16_weights,
766 CB=copy.deepcopy(self.CB, memo),
767 SCB=copy.deepcopy(self.SCB, memo),
768 )
769 return new_instance
770
771 @overload
772 def to(

Callers

nothing calls this directly

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected