diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-12-01 14:07:24 -0700 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-12-01 14:07:24 -0700 |
commit | eb865fa4683bca9a9d7c840f8addd30e39b62f5b (patch) | |
tree | a6b21f0462fd03fd88ecf4e7fb6236a7760a7d0f /numpy/array_api/_array_object.py | |
parent | 4194a94f08763599014e92713be8a63446cd76d4 (diff) | |
download | numpy-eb865fa4683bca9a9d7c840f8addd30e39b62f5b.tar.gz |
BUG: Fix the .T attribute in the array_api namespace
Fixes #20498.
Diffstat (limited to 'numpy/array_api/_array_object.py')
-rw-r--r-- | numpy/array_api/_array_object.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/array_api/_array_object.py b/numpy/array_api/_array_object.py index 8794c5ea5..ead061882 100644 --- a/numpy/array_api/_array_object.py +++ b/numpy/array_api/_array_object.py @@ -1072,4 +1072,4 @@ class Array: # https://data-apis.org/array-api/latest/API_specification/array_object.html#t if self.ndim != 2: raise ValueError("x.T requires x to have 2 dimensions. Use x.mT to transpose stacks of matrices and permute_dims() to permute dimensions.") - return self._array.T + return self.__class__._new(self._array.T) |