Tensor#

class ninetoothed.Tensor(ndim=None, shape=None, dtype=None, strides=None, other=None, constexpr_shape=None, name=None, source=None, source_dims=None, target=None, target_dims=None)#

A class uesed 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.

  • strides – The strides of the tensor.

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

  • constexpr_shape – Whether the sizes are constexpr.

  • name – The name of the tensor.

  • source – For internal use only.

  • source_dims – For internal use only.

  • target – For internal use only.

  • target_dims – For internal use only.

Meta-Operations#

ninetoothed.Tensor.tile

Tiles the tensor into a hierarchical tensor.

ninetoothed.Tensor.expand

Expands the specified singleton dimensions of the tensor.

ninetoothed.Tensor.squeeze

Removes the specified singleton dimensions of the tensor.

ninetoothed.Tensor.permute

Permutes the dimensions of the tensor.

ninetoothed.Tensor.flatten

Flattens the specified dimensions of the tensor.

ninetoothed.Tensor.ravel

Flattens the hierarchy of the tensor.