(model, data, *, compile_with=None)
| 138 | # If any hash is different, then that's where the numerical divergence is coming from. |
| 139 | |
| 140 | def run_model(model, data, *, compile_with=None): |
| 141 | if compile_with is not None: |
| 142 | model = torch.compile(model, backend=compile_with) |
| 143 | with DebugMode(record_output=True) as dm, DebugMode.log_tensor_hashes( |
| 144 | hash_inputs=True, |
| 145 | ): |
| 146 | dm_out = model(*data) |
| 147 | return dm, dm_out |
| 148 | |
| 149 | class Toy(torch.nn.Module): |
| 150 | def forward(self, x): |
no test coverage detected