mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
RFC: https://github.com/pytorch/rfcs/pull/54 First commit is the contents of https://github.com/Quansight-Labs/numpy_pytorch_interop/ We have already been using this in core for the last few months as a external dependency. This PR pulls all these into core. In the next commits, I do a number of things in this order - Fix a few small issues - Make the tests that this PR adds pass - Bend backwards until lintrunner passes - Remove the optional dependency on `torch_np` and simply rely on the upstreamed code - Fix a number dynamo tests that were passing before (they were not tasting anything I think) and are not passing now. Missing from this PR (but not blocking): - Have a flag that deactivates tracing NumPy functions and simply breaks. There used to be one but after the merge stopped working and I removed it. @lezcano to investigate. - https://github.com/pytorch/pytorch/pull/106431#issuecomment-1667079543. @voznesenskym to submit a fix after we merge. All the tests in `tests/torch_np` take about 75s to run. This was a work by @ev-br, @rgommers @honno and I. I did not create this PR via ghstack (which would have been convenient) as this is a collaboration, and ghstack doesn't allow for shared contributions. Pull Request resolved: https://github.com/pytorch/pytorch/pull/106211 Approved by: https://github.com/ezyang
29 lines
544 B
Python
29 lines
544 B
Python
from . import fft, linalg, random
|
|
from ._dtypes import * # noqa: F403
|
|
from ._funcs import * # noqa: F403
|
|
from ._getlimits import errstate, finfo, iinfo
|
|
from ._ndarray import (
|
|
array,
|
|
asarray,
|
|
ascontiguousarray,
|
|
can_cast,
|
|
from_dlpack,
|
|
ndarray,
|
|
newaxis,
|
|
result_type,
|
|
)
|
|
from ._ufuncs import * # noqa: F403
|
|
from ._util import AxisError, UFuncTypeError
|
|
|
|
# from . import testing
|
|
|
|
alltrue = all
|
|
sometrue = any
|
|
|
|
inf = float("inf")
|
|
nan = float("nan")
|
|
from math import pi, e # isort: skip
|
|
|
|
False_ = False
|
|
True_ = True
|