Commit Graph

5 Commits

Author SHA1 Message Date
Xuehai Pan
5b1cedacde [BE] [2/3] Rewrite super() calls in functorch and torch (#94588)
Rewrite Python built-in class `super()` calls. Only non-semantic changes should be applied.

- #94587
- #94588
- #94592

Also, methods with only a `super()` call are removed:

```diff
class MyModule(nn.Module):
-   def __init__(self):
-       super().__init__()
-
    def forward(self, ...):
        ...
```

Some cases that change the semantics should be kept unchanged. E.g.:

f152a79be9/caffe2/python/net_printer.py (L184-L190)

f152a79be9/test/test_jit_fuser_te.py (L2628-L2635)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94588
Approved by: https://github.com/ezyang, https://github.com/albanD
2023-02-10 21:16:33 +00:00
Richard Zou
19c7a6b54b [functorch] Update notebooks for latest release (#85855)
This PR:
- dedups our colab notebooks with the regular functorch notebooks. The
colab notebooks were versions of the reuglar notebooks that had
install instructions. Now that functorch is easier to install, we do not
need those anymore.
- fixes the colab links

Test Plan:
- build docs locally and tested them
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85855
Approved by: https://github.com/samdow
2022-09-29 20:00:34 +00:00
Roman Novak
e642a34627 [functorch] Add complexities and references for NTK implementations. (pytorch/functorch#907)
* Add complexities and references for NTK implementations.

* Fix result names; rename "outer product" -> "matrix product".

* Fix names
2022-07-21 13:41:36 -07:00
Local State
ff9558a2ea [functorch] Update neural_tangent_kernels.ipynb (pytorch/functorch#788)
Fix a small bug
```python3
    if compute == 'full':
        return result
    if compute == 'trace':
        return torch.einsum('NMKK->NM')        # should be torch.einsum('NMKK->NM', result)
    if compute == 'diagonal':
        return torch.einsum('NMKK->NMK')        # should be torch.einsum('NMKK->NMK', result)
```
2022-07-21 13:41:33 -07:00
Richard Zou
3110183992 [functorch] Neural Tangent Kernels tutorial (pytorch/functorch#540) 2022-07-21 13:41:25 -07:00