Tensor Manipulation Routines¶
Basic manipulations¶
Copies values from one array to another, broadcasting as necessary. 
Shape manipulation¶
Gives a new shape to a tensor without changing its data. 

Return a contiguous flattened tensor. 
Transposition¶
Move axes of a tensor to new positions. 

Roll the specified axis backwards, until it lies in a given position. 

Interchange two axes of a tensor. 

Same as self.transpose(), except that self is returned if self.ndim < 2. 

Permute the dimensions of a tensor. 
Edit dimensionalities¶
Convert inputs to tensors with at least one dimension. 

View inputs as tensors with at least two dimensions. 

View inputs as tensors with at least three dimensions. 

Broadcast an tensor to a new shape. 

Broadcast any number of arrays against each other. 

Expand the shape of a tensor. 

Remove singledimensional entries from the shape of a tensor. 
Changing kind of tensor¶
Convert the input to an array. 
Joining tensors¶
Join a sequence of arrays along an existing axis. 

Join a sequence of tensors along a new axis. 

Stack 1D tensors as columns into a 2D tensor. 

Stack tensors in sequence depth wise (along third axis). 

Stack tensors in sequence horizontally (column wise). 

Stack tensors in sequence vertically (row wise). 
Splitting tensors¶
Split a tensor into multiple subtensors. 

Split a tensor into multiple subtensors. 

Split tensor into multiple subtensors along the 3rd axis (depth). 

Split a tensor into multiple subtensors horizontally (columnwise). 

Split a tensor into multiple subtensors vertically (rowwise). 
Tiling tensors¶
Construct a tensor by repeating A the number of times given by reps. 

Repeat elements of a tensor. 
Adding and removing elements¶
Insert values along the given axis before the given indices. 

Return a new array with subarrays along an axis deleted. 

Find the unique elements of a tensor. 
Rearranging elements¶
Reverse the order of elements in a tensor along the given axis. 

Flip tensor in the left/right direction. 

Flip tensor in the up/down direction. 

Gives a new shape to a tensor without changing its data. 

Roll tensor elements along a given axis. 