(self, ys, dys)
| 49 | return self |
| 50 | |
| 51 | def __call__(self, ys, dys): |
| 52 | from collections.abc import Sequence |
| 53 | |
| 54 | if not isinstance(ys, Sequence): |
| 55 | ys = [ys] |
| 56 | |
| 57 | if not isinstance(dys, Sequence): |
| 58 | dys = [dys] |
| 59 | |
| 60 | group = [ref() for ref in self._group] |
| 61 | |
| 62 | for grad in group: |
| 63 | if grad is self: |
| 64 | continue |
| 65 | grad.suppress() |
| 66 | |
| 67 | self._impl.backward(ys, dys) |
| 68 | |
| 69 | for grad in group: |
| 70 | if grad is self: |
| 71 | continue |
| 72 | grad.resume() |
| 73 | |
| 74 | self._refkeeper = None |
| 75 | return None |
| 76 | |
| 77 | def __enter__(self): |
| 78 | ref = weakref.ref(self) |