Skip to content

Commit d1be133

Browse files
committed
BUG: Fix the .T attribute in the array_api namespace
Fixes #20498. Original NumPy Commit: eb865fa4683bca9a9d7c840f8addd30e39b62f5b
1 parent 11ebcb6 commit d1be133

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array_api_strict/_array_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,4 +1072,4 @@ def T(self) -> Array:
10721072
# https://data-apis.org/array-api/latest/API_specification/array_object.html#t
10731073
if self.ndim != 2:
10741074
raise ValueError("x.T requires x to have 2 dimensions. Use x.mT to transpose stacks of matrices and permute_dims() to permute dimensions.")
1075-
return self._array.T
1075+
return self.__class__._new(self._array.T)

0 commit comments

Comments
 (0)