Detach the tensors from the computation graph See: https://pytorch.org/docs/stable/generated/torch.Tensor.detach.html
(self, *arrays)
| 288 | raise NotImplementedError() |
| 289 | |
| 290 | def detach(self, *arrays): |
| 291 | """Detach the tensors from the computation graph |
| 292 | |
| 293 | See: https://pytorch.org/docs/stable/generated/torch.Tensor.detach.html""" |
| 294 | if len(arrays) == 1: |
| 295 | return self._detach(arrays[0]) |
| 296 | else: |
| 297 | return [self._detach(array) for array in arrays] |
| 298 | |
| 299 | def _detach(self, a): |
| 300 | """Detach the tensor from the computation graph""" |