Type

class madspace.Type(*args, **kwargs)

Bases: pybind11_object

Full type of a compute-graph Value.

It combines an element DataType, a symbolic BatchSize and a static trailing shape.

The logical tensor shape is (batch_size, shape...). A batch_sizes value instead holds batch_size_list and has no element shape.

Overloaded function.

  1. __init__(self: madspace._madspace_py.Type, dtype: madspace._madspace_py.DataType, batch_size: madspace._madspace_py.BatchSize, shape: collections.abc.Sequence[typing.SupportsInt]) -> None

Parameters:
  • dtype – element data type

  • batch_size – symbolic size of the batch dimension

  • shape – static trailing dimensions

  1. __init__(self: madspace._madspace_py.Type, batch_size_list: collections.abc.Sequence[madspace._madspace_py.BatchSize]) -> None

Construct a batch_sizes type carrying batch_size_list.

property batch_size

Symbolic size of the leading batch dimension.

property dtype

Element data type.

property shape

Static trailing dimensions, without the batch dimension.