concepts.dsl.dsl_types#

Data structures for custom types in a DSL.

All types extend the base class TypeBase.

TypeBase has four derived types:

- :class:`ObjectType`: corresponds to an object in the physical world.
- :class:`ValueType`: corresponds to an encoding of a feature of the object.
- :class:`Sequence`: corresponds to a tuple type, a list type, or a multidimensional list type.
- :class:`~concepts.dsl.dsl_functions.FunctionType`: corresponds to a function over the encodings.
- :class:`~concepts.dsl.dsl_functions.OverloadedFunctionType`: corresponds to a collection of functions that share the same name.
- :class:`UnionType`: corresponds to a union of types.

Furthermore, ValueType has four derived types:

- :class:`ConstantType`: corresponds to a constant.
- :class:`TensorValueTypeBase`: corresponds to a tensor-based encoding.
- :class:`PyObjValueType`: corresponds to an arbitrary Python object.

TensorValueTypeBase has three derived types:

- :class:`ScalarValueType`: corresponds to a scalar value.
- :class:`VectorValueType`: corresponds to a vector.
- :class:`NamedTensorValueType`: corresponds to a named tensor.

SequenceType has two derived types:

- :class:`TupleType`: corresponds to a tuple.
- :class:`ListType`: corresponds to a list. This type is also of type :class:`VariableSizedSequenceType`.
- :class:`MultidimensionalListType`: corresponds to a multidimensional list. This type is also of type :class:`VariableSizedSequenceType`.

Module attributes

AnyType

AutoType means the type will be automatically inferred later.

QINDEX

The "quantified index" object, used to indicate a quantified dimension in a tensor value type.

Functions

is_any_type(t)

Check if the type is AnyType.

is_auto_type(t)

Check if the type is AutoType.

Classes

AliasType

BatchedListType

ConstantType

The ConstantType corresponds to a constant value.

FormatContext

FormatContext is a context manager that controls the format of types and objects.

ListType

NamedTensorValueType

ObjectConstant

The class representing a constant object in a DSL.

ObjectType

The ObjectType corresponds to the type of "real-world" objects.

PyObjValueType

ScalarValueType

SequenceType

The basic sequence type.

TensorValueTypeBase

A value type refers to a type of some features associated with physical objects.

TupleType

TypeBase

Base class for all types.

UniformSequenceType

UnionType

The UnionType is a type that is the union of multiple types.

UnnamedPlaceholder

ValueType

The ValueType corresponds to a value of a certain type.

Variable

The class representing a variable in a function.

VectorValueType