subclass_zoo
subclass_zoo copied to clipboard
Aka, https://github.com/pytorch/pytorch/issues/69991 ## Motivation We should make sure all PyTorch operations are "Composite Compliant". This condition is necessary for operators that look out-of-place to preserve the Tensor Subclass when passed...
https://github.com/pytorch/pytorch/issues/62884 this is a footgun for python keys who don't expect to see conjugate values
In progress PR at https://github.com/pytorch/pytorch/pull/72729
torch function is public API while torch dispatch is not, it may be friendlier to people if they can program against torch function api.
https://github.com/pytorch/pytorch/pull/73727 is an attempt at doing this it ran into problems. Fortunately, we have an updated plan at https://github.com/pytorch/pytorch/pull/73727#issuecomment-1059216810 that just needs to be implemented
There is a PR at https://github.com/pytorch/pytorch/pull/74469 but it's wrong and we need a better strategy
Simple functorch suggests that these are the wrong APIs https://colab.research.google.com/github/albanD/subclass_zoo/blob/main/simple_functorch.ipynb but due to how the dispatcher is implemented it is not easy to prevent people from accidentally going back to...
https://github.com/pytorch/pytorch/pull/73942 is blocked because torch function gets disabled in the default implementation and then if you fall through to Python key it is still disabled, which breaks FX tracing. So...
This should be as simple as just swapping from CompositeImplicitAutograd to explicit; they are de facto explicit already because there is a codegen special case.
https://github.com/albanD/subclass_zoo/blob/main/complex_tensor.py#L27-L31 right?