What do you think about the api-array-compat project?
It should be not so difficult to change the backend from PyTorch to api-array-compat, and it will give many advantages:
- Simplify array type selection/verification logic
- Add
cupy support for those who want to calculate on GPU, but don't need backpropagation or don't want to install PyTorch
- Make
PyTorch dependence optional