Tensor Creation Routines#

From shape or value#

maxframe.tensor.ones

Return a new tensor of given shape and type, filled with ones.

maxframe.tensor.zeros

Return a new tensor of given shape and type, filled with zeros.

maxframe.tensor.empty

Return a new tensor of given shape and type, without initializing entries.

maxframe.tensor.empty_like

Return a new tensor with the same shape and type as a given tensor.

maxframe.tensor.full

Return a new tensor of given shape and type, filled with fill_value.

maxframe.tensor.full_like

Return a full tensor with the same shape and type as a given tensor.

From existing data#

maxframe.tensor.tensor

maxframe.tensor.array

Create a tensor.

maxframe.tensor.asarray

Convert the input to an array.

Building matrices#

maxframe.tensor.diag

Extract a diagonal or construct a diagonal tensor.

maxframe.tensor.diagflat

Create a two-dimensional tensor with the flattened input as a diagonal.

maxframe.tensor.tril

Lower triangle of a tensor.

maxframe.tensor.triu

Upper triangle of a tensor.

Numerical ranges#

maxframe.tensor.arange

Return evenly spaced values within a given interval.

maxframe.tensor.linspace

Return evenly spaced numbers over a specified interval.

maxframe.tensor.meshgrid

Return coordinate matrices from coordinate vectors.

maxframe.tensor.mgrid

Construct a multi-dimensional "meshgrid".

maxframe.tensor.ogrid

Construct a multi-dimensional "meshgrid".