Repository: e3nn/e3nn (language: python)

Issue:
Fix TorchScript warning "doesn't support instance-level annotations"
<!-- Provide a general summary of your changes in the Title above. -->

## Description
In recent PyTorch versions, this warning has started coming up a lot:
```
UserWarning: The TorchScript type system doesn't support instance-level annotations on empty non-base types in `__init__`. Instead, either 1) use a type annotation in the class body, or 2) wrap the type in `torch.jit.Attribute`.
```

## How Has This Been Tested?
All unit tests pass locally, with GPU.

## Checklist:
<!-- Put an `x` in all the boxes that apply. If you're unsure about any of
     these, don't hesitate to ask. We're here to help! -->
- [ X ] I have read the [**CONTRIBUTING**](https://github.com/e3nn/e3nn/blob/main/.github/CONTRIBUTING.md) document.
- [ X ] My code follows the code style of this project.
- [ X ] I have updated the documentation (if relevant).
- [ X ] I have added tests that cover my changes (if relevant).
- [ X ] The modified code is cuda compatible (github tests don't test cuda) (if relevant).
- [ ] I have updated the [CHANGELOG](https://github.com/e3nn/e3nn/blob/main/.github/CHANGELOG.md).



Discussion / hints:
See also https://github.com/pytorch/pytorch/issues/89064
Tell me when you want to merge
Thanks @mariogeiger --- ideally just want to see the tests pass, and if anyone else wants to take a quick look to make sure I didn't make any typos / logical errors in this, since it touches some of the compilation logic that underpins most of the library.
Looks good from my side. Thanks for cleaning up the Torch2 stuff
There is a problem with the tests

Why does this file exist? https://github.com/e3nn/e3nn/blob/main/examples/conftest.py
It seems like a duplicate of the one in `tests/`...
No idea, does it help it you delete it?

Let's find out 😄 
I suspect it's due to a combination of that file and the fact that the GitHub actions are set up run any tests anywhere in the repo:
https://github.com/e3nn/e3nn/blob/main/.github/workflows/tests.yml#L56

instead of only in the `tests/` folder.  Is that intentional?

(Either way seem to be running fine now)
I remember the examples were failing because of torch-cluster, torch-sparse… import issues when I was testing locally. 

Hopefully this also fixed that 

Update: Yup it did !
For the Torch 2 test that is failing its running alright locally when I do
```
pytest --doctest-modules --ignore=docs/ tests/o3/experimental/test_fulltp.py
```
so not sure what's happening there
Is there a way to just not run tests or flake8 on anything in `experimental` right now?
Either way, it does look like all failures are unrelated to this PR, so I think we're good to merge, thanks!
Do you mind doing a `--ignore=tests/o3/experimental` or should I put it another PR ?
Ok let me merge and feel free to make another PR to fix this test problem 

Fix patch:
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 5e184aff..846bf6b4 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -5,20 +5,19 @@
 # Required
 version: 2
 
-# added following nbsphinx instructions
-formats: all
+# Set the version of Python and other tools you might need
+build:
+  os: ubuntu-22.04
+  tools:
+    python: "3.11"
 
 # Build documentation in the docs/ directory with Sphinx
 sphinx:
-  configuration: docs/conf.py
+   configuration: docs/conf.py
 
-# Build documentation with MkDocs
-#mkdocs:
-#  configuration: mkdocs.yml
-
-# Optionally set the version of Python and requirements required to build your docs
+# Optionally declare the Python requirements required to build your docs
 python:
-  version: 3.8
-  install:
-    - requirements: docs/requirements.txt
-  system_packages: true  # added following nbsphinx instructions
+   install:
+   - requirements: docs/requirements.txt
+   - method: pip
+     path: .
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 3a042911..fb7a59ca 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -10,7 +10,7 @@ jupyter-sphinx
 ase
 
 --find-links https://download.pytorch.org/whl/cpu
-torch==2.0.0
+torch==2.*
 
 --find-links https://data.pyg.org/whl/torch-2.0.0+cpu.html
 torch-scatter


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index e33086bc..1d15c42d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -53,7 +53,7 @@ jobs:
         pip install coveralls
     - name: Test with pytest
       run: |
-        coverage run --source=e3nn -m pytest --doctest-modules --ignore=docs/ .
+        coverage run --source=e3nn -m pytest --doctest-modules --ignore=docs/ --ignore-glob='**/experimental*' tests examples
     - name: Upload to coveralls
       env:
         COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}