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

Method initialize

bitsandbytes/utils.py:50–61  ·  view source on GitHub ↗
(self, model)

Source from the content-addressed store, hash-verified

48 raise RuntimeError("Call get_instance() instead")
49
50 def initialize(self, model):
51 self.last_w = None
52 self.current_outlier_dims = None
53 self.hvalues = []
54 self.outliers = []
55 self.hvalue2outlier_idx = {}
56 self.initialized = True
57 self.hooks = []
58
59 for n, m in model.named_modules():
60 if isinstance(m, torch.nn.Linear):
61 self.hooks.append(m.register_forward_pre_hook(outlier_hook))
62
63 def is_initialized(self):
64 return getattr(self, "initialized", False)

Callers 2

test_global_configFunction · 0.45

Calls

no outgoing calls

Tested by 2

test_global_configFunction · 0.36