File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,42 @@ def T(self):
110
110
111
111
@property
112
112
def mT (self ):
113
- """View of the matrix transposed array."""
113
+ """
114
+ View of the matrix transposed array.
115
+
116
+ The matrix transpose is the transpose of the last two dimensions, even
117
+ if the array is of higher dimension.
118
+
119
+ Raises
120
+ ------
121
+ ValueError
122
+ If the array is of dimension less than 2.
123
+
124
+ Examples
125
+ --------
126
+ >>> import dpnp as np
127
+ >>> a = np.array([[1, 2], [3, 4]])
128
+ >>> a
129
+ array([[1, 2],
130
+ [3, 4]])
131
+ >>> a.mT
132
+ array([[1, 3],
133
+ [2, 4]])
134
+
135
+ >>> a = np.arange(8).reshape((2, 2, 2))
136
+ >>> a
137
+ array([[[0, 1],
138
+ [2, 3]],
139
+ [[4, 5],
140
+ [6, 7]]])
141
+ >>> a.mT
142
+ array([[[0, 2],
143
+ [1, 3]],
144
+ [[4, 6],
145
+ [5, 7]]])
146
+
147
+ """
148
+
114
149
if self .ndim < 2 :
115
150
raise ValueError ("matrix transpose with ndim < 2 is undefined" )
116
151
You can’t perform that action at this time.
0 commit comments