Tensor Creation Routines#
Basic creation routines#
Return a new tensor of given shape and type, without initializing entries. |
|
Return a new tensor with the same shape and type as a given tensor. |
|
Return a 2-D tensor with ones on the diagonal and zeros elsewhere. |
|
Return the identity tensor. |
|
Return a new tensor of given shape and type, filled with ones. |
|
Return a tensor of ones with the same shape and type as a given tensor. |
|
Return a new tensor of given shape and type, filled with zeros. |
|
Return a tensor of zeros with the same shape and type as a given tensor. |
|
Return a new tensor of given shape and type, filled with fill_value. |
Creation from other data#
Create a tensor. |
|
Convert the input to an array. |
|
Return a contiguous tensor (ndim >= 1) in memory (C order). |
Numerical ranges#
Return evenly spaced values within a given interval. |
|
Return evenly spaced numbers over a specified interval. |
|
Return coordinate matrices from coordinate vectors. |
|
Construct a multi-dimensional "meshgrid". |
|
Construct a multi-dimensional "meshgrid". |
Building matrices#
Extract a diagonal or construct a diagonal tensor. |
|
Create a two-dimensional tensor with the flattened input as a diagonal. |
|
Lower triangle of a tensor. |
|
Upper triangle of a tensor. |