Open ev-br opened 1 year ago
Oops forgot to share the sample diff on doing this for test_indexing.py
As mentioned it's a bit finnicky as you have to check np is {numpy,torch_np}
for some module-specific behaviour, e.g. raised error classes and skips/xfails, and you have to make sure you're using the argument np
for things like the {numpy,torch_np}.testing
utils.
So IMO probably not something we'd want to rework our existing tests for, but instead use just when we want to sanity check things as-and-when desired.
https://github.com/Quansight-Labs/numpy_pytorch_interop/pull/77 puts a nice scaffolding for being able to toggle the context for individual tests between the original numpy and torch_np. Let's think how to best organize this sort of testing.