| 58 | |
| 59 | |
| 60 | class no_act_recording: |
| 61 | def __init__(self, model): |
| 62 | self.model = model |
| 63 | |
| 64 | def __enter__(self): |
| 65 | for name, module in self.model.named_modules(): |
| 66 | if isinstance(module, ActLinear): |
| 67 | module.record_activation = False |
| 68 | |
| 69 | def __exit__(self, exc_type, exc_val, exc_tb): |
| 70 | for name, module in self.model.named_modules(): |
| 71 | if isinstance(module, ActLinear): |
| 72 | module.record_activation = True |
| 73 | |
| 74 | |
| 75 | class set_mask: |
no outgoing calls
no test coverage detected