(self, accumulate_grad_batches)
| 1083 | logging.info(param, param.grad) |
| 1084 | |
| 1085 | def configure_accumulated_gradients(self, accumulate_grad_batches): |
| 1086 | self.accumulate_grad_batches = None |
| 1087 | |
| 1088 | if isinstance(accumulate_grad_batches, dict): |
| 1089 | self.accumulation_scheduler = GradientAccumulationScheduler(accumulate_grad_batches) |
| 1090 | elif isinstance(accumulate_grad_batches, int): |
| 1091 | schedule = {1: accumulate_grad_batches} |
| 1092 | self.accumulation_scheduler = GradientAccumulationScheduler(schedule) |
| 1093 | else: |
| 1094 | raise TypeError("Gradient accumulation supports only int and dict types") |
| 1095 | |
| 1096 | def get_dataloaders(self, model): |
| 1097 | if not self.testing: |
no test coverage detected