MCPcopy Create free account
hub / github.com/boyiwei/alignment-attribution-code / __enter__

Method __enter__

lib/model_wrapper.py:80–83  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

78 self.mask = mask
79
80 def __enter__(self):
81 for name, module in self.model.named_modules():
82 if isinstance(module, ActLinear):
83 module.mask = self.mask
84
85 def __exit__(self, exc_type, exc_val, exc_tb):
86 for name, module in self.model.named_modules():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected