mygrad.Tensor.T#

property Tensor.T: Tensor#

Same as self.transpose(), except that self is returned if self.ndim < 2 and a view of the underlying data is utilized whenever possible.

Returns:
Tensor

Examples

>>> import mygrad as mg
>>> y = mg.Tensor([[1, 2, 3],
...                [4, 5, 6]])
>>> y.T
Tensor([[1, 4],
        [2, 5],
        [3, 6]])