Tensor#

class ninetoothed.Tensor(ndim=None, shape=None, dtype=None, jagged_dim=None, other=None, shape_options=None, constexpr=None, value=None, name=None, source=None, target_dims=None, _offsets=None, _outputs=None)#

A class used to represent a symbolic tensor.

Parameters:
  • ndim – The number of dimensions of the tensor.

  • shape – The shape of the tensor.

  • dtype – The element type of the tensor.

  • jagged_dim – The jagged dimension of the tensor.

  • other – The values for out-of-bounds positions.

  • shape_options – The options for configuring shape symbols.

  • name – The name of the tensor.

  • source – For internal use only.

  • target_dims – For internal use only.

Meta-Operations#

ninetoothed.Tensor.tile

Tile the tensor into a hierarchical tensor.

ninetoothed.Tensor.expand

Expand the specified singleton dimensions of the tensor.

ninetoothed.Tensor.unsqueeze

Insert a singleton dimension in the tensor.

ninetoothed.Tensor.squeeze

Remove the specified singleton dimensions of the tensor.

ninetoothed.Tensor.permute

Permute the dimensions of the tensor.

ninetoothed.Tensor.flatten

Flatten the specified dimensions of the tensor.

ninetoothed.Tensor.ravel

Flatten the hierarchy of the tensor.

ninetoothed.Tensor.pad

Pad the tensor with the specified padding.

Evaluation#

ninetoothed.Tensor.eval

Evaluate the symbolic tensor into a numeric tensor.

ninetoothed.Tensor.subs

Substitute symbols in the tensor.