summaryrefslogtreecommitdiff
path: root/numpy/array_api/_array_object.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-12-01 19:52:12 -0700
committerGitHub <noreply@github.com>2021-12-01 19:52:12 -0700
commit742f13f7ee6ff8ed56fc468c9ef57b3853141768 (patch)
tree3eed2beabeeabf6c7261f2a44fc2c2723f65883a /numpy/array_api/_array_object.py
parent4194a94f08763599014e92713be8a63446cd76d4 (diff)
parent18fe695dbc66df660039aca9f76a949de8b9348e (diff)
downloadnumpy-742f13f7ee6ff8ed56fc468c9ef57b3853141768.tar.gz
Merge pull request #20499 from asmeurer/array_api_T
BUG: Fix the .T attribute in the array_api namespace
Diffstat (limited to 'numpy/array_api/_array_object.py')
-rw-r--r--numpy/array_api/_array_object.py2
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)