Tensor manipulation routines (mygrad.tensor_manip
)#
Changing array shape#
|
Flattens contents of a tensor into a contiguous 1-D array. |
|
Returns a tensor with a new shape, without changing its data. |
|
Return a copy of the tensor collapsed into one dimension. |
Transpose-like operations#
|
Move axes of a tensor to new positions. |
|
Roll tensor elements along a given axis. |
|
Interchange two axes of a 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. |
|
|
Permute the dimensions of a tensor. |
Changing number of dimensions#
Convert inputs to tensors with at least one dimension. |
|
Convert inputs to tensors with at least one dimension. |
|
Convert inputs to tensors with at least one dimension. |
|
|
Broadcast a tensor to a new shape. |
|
Expand the dimensions of a tensor by adding a new axis. |
|
Remove single-dimensional entries from the shape of a tensor. |
Joining tensors#
|
Join a sequence of tensors along an existing axis. |
|
Join a sequence of tensors along a new axis. |
Tiling tensors#
|
Repeat elements of a tensor. |