(self, outputs: list, **kwargs)
| 22 | return super().pre_forward_hook(inputs, **kwargs) |
| 23 | |
| 24 | def post_forward_hook(self, outputs: list, **kwargs) -> list: |
| 25 | output_tensor = outputs[0] |
| 26 | assert isinstance(output_tensor, torch.Tensor), ( |
| 27 | 'Output of monitoring operation is not a torch.Tensor') |
| 28 | self.fetched = batch_random_fetch( |
| 29 | output_tensor, seed=10086, fetches_per_batch=self.fetchs |
| 30 | ).to('cpu') |
| 31 | return super().post_forward_hook(outputs, **kwargs) |
| 32 | |
| 33 | def pop(self) -> torch.Tensor: |
| 34 | fetched = self.fetched |
no test coverage detected