mlir.extras.types¶
Attributes¶
Classes¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- class mlir.extras.types.Attribute(cast_from_type: Attribute)¶
- property _CAPIPtr: object¶
Gets a capsule wrapping the MlirAttribute.
- static _CAPICreate(arg: object, /) Attribute¶
Creates an Attribute from a capsule wrapping
MlirAttribute.
- static parse(asm: str, context: Context | None = None) Attribute¶
Parses an attribute from an assembly form. Raises an
MLIRErroron failure.
- get_named(arg: str, /) NamedAttribute¶
Binds a name to the attribute, creating a NamedAttribute.
- Parameters:
name – The name to bind to the Attribute.
- Returns:
A NamedAttribute with the given name and this attribute.
- __eq__(arg: Attribute, /) bool¶
- __eq__(arg: object, /) bool
Compares attribute with non-attribute object (always returns False).
- __hash__() int¶
Returns the hash value of the attribute.
- dump() None¶
Dumps a debug representation of the object to stderr.
- __str__() str¶
Returns the assembly form of the Attribute.
- __repr__() str¶
Returns a string representation of the attribute.
- class mlir.extras.types.BF16Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.ComplexType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(arg: Type, /) ComplexType¶
Create a complex type
- class mlir.extras.types.F16Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.F32Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.F64Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.Float4E2M1FNType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float4E2M1FNType¶
Create a float4_e2m1fn type.
- class mlir.extras.types.Float6E2M3FNType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float6E2M3FNType¶
Create a float6_e2m3fn type.
- class mlir.extras.types.Float6E3M2FNType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float6E3M2FNType¶
Create a float6_e3m2fn type.
- class mlir.extras.types.Float8E3M4Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E3M4Type¶
Create a float8_e3m4 type.
- class mlir.extras.types.Float8E4M3B11FNUZType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E4M3B11FNUZType¶
Create a float8_e4m3b11fnuz type.
- class mlir.extras.types.Float8E4M3FNType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E4M3FNType¶
Create a float8_e4m3fn type.
- class mlir.extras.types.Float8E4M3Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E4M3Type¶
Create a float8_e4m3 type.
- class mlir.extras.types.Float8E5M2Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E5M2Type¶
Create a float8_e5m2 type.
- class mlir.extras.types.Float8E8M0FNUType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) Float8E8M0FNUType¶
Create a float8_e8m0fnu type.
- class mlir.extras.types.Float8E5M3FNUType(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- static get(context: Context | None = None) Float8E5M3FNUType¶
Create a float8_e5m3fnu type.
- class mlir.extras.types.FloatTF32Type(cast_from_type: Type)¶
Bases:
FloatType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(context: Context | None = None) FloatTF32Type¶
Create a tf32 type.
- class mlir.extras.types.FunctionType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(inputs: collections.abc.Sequence[Type], results: collections.abc.Sequence[Type], context: Context | None = None) FunctionType¶
Gets a FunctionType from a list of input and result types
- class mlir.extras.types.IndexType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.IntegerType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class Signedness¶
Bases:
enum.EnumGeneric enumeration.
Derive from this class to define new enumerations.
- SIGNLESS = 0¶
- SIGNED = 1¶
- UNSIGNED = 2¶
- SIGNLESS: IntegerType¶
- SIGNED: IntegerType¶
- UNSIGNED: IntegerType¶
- static get_signless(width: int, context: Context | None = None) IntegerType¶
Create a signless integer type
- static get_signed(width: int, context: Context | None = None) IntegerType¶
Create a signed integer type
- static get_unsigned(width: int, context: Context | None = None) IntegerType¶
Create an unsigned integer type
- static get(width: int, signedness: IntegerType = IntegerType.Signedness.SIGNLESS, context: Context | None = None) IntegerType¶
Create an integer type
- property signedness: IntegerType¶
- property width: int¶
Returns the width of the integer type
- property is_signless: bool¶
Returns whether this is a signless integer
- property is_signed: bool¶
Returns whether this is a signed integer
- property is_unsigned: bool¶
Returns whether this is an unsigned integer
- class mlir.extras.types.MemRefType(cast_from_type: Type)¶
Bases:
ShapedType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(shape: collections.abc.Sequence[int], element_type: Type, layout: Attribute | None = None, memory_space: Attribute | None = None, loc: Location | None = None) MemRefType¶
Create a memref type
- static get_unchecked(shape: collections.abc.Sequence[int], element_type: Type, layout: Attribute | None = None, memory_space: Attribute | None = None, context: Context | None = None) MemRefType¶
Create a memref type
- get_strides_and_offset() tuple[list[int], int]¶
The strides and offset of the MemRef type.
- class mlir.extras.types.NoneType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- class mlir.extras.types.OpaqueType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(dialect_namespace: str, buffer: str, context: Context | None = None) OpaqueType¶
Create an unregistered (opaque) dialect type.
- property dialect_namespace: str¶
Returns the dialect namespace for the Opaque type as a string.
- property data: str¶
Returns the data for the Opaque type as a string.
- class mlir.extras.types.RankedTensorType(cast_from_type: Type)¶
Bases:
ShapedType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(shape: collections.abc.Sequence[int], element_type: Type, encoding: Attribute | None = None, loc: Location | None = None) RankedTensorType¶
Create a ranked tensor type
- static get_unchecked(shape: collections.abc.Sequence[int], element_type: Type, encoding: Attribute | None = None, context: Context | None = None) RankedTensorType¶
Create a ranked tensor type
- class mlir.extras.types.StridedLayoutAttr(cast_from_attr: Attribute)¶
Bases:
Attribute- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- __repr__() str¶
Returns a string representation of the attribute.
- attr_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(offset: int, strides: collections.abc.Sequence[int], context: Context | None = None) StridedLayoutAttr¶
Gets a strided layout attribute.
- static get_fully_dynamic(rank: int, context: Context | None = None) StridedLayoutAttr¶
Gets a strided layout attribute with dynamic offset and strides of a given rank.
- property offset: int¶
Returns the value of the float point attribute
- property strides: list[int]¶
Returns the value of the float point attribute
- class mlir.extras.types.StringAttr(cast_from_attr: Attribute)¶
Bases:
Attribute- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- __repr__() str¶
Returns a string representation of the attribute.
- attr_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(value: str, context: Context | None = None) StringAttr¶
- static get(value: bytes, context: Context | None = None) StringAttr
- static get_typed(type: Type, value: str) StringAttr¶
Gets a uniqued string attribute associated to a type
- property value: str¶
Returns the value of the string attribute
- property value_bytes: bytes¶
Returns the value of the string attribute as
bytes
- class mlir.extras.types.TupleType(cast_from_type: Type)¶
Bases:
Type- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get_tuple(elements: collections.abc.Sequence[Type], context: Context | None = None) TupleType¶
Create a tuple type
- property num_types: int¶
Returns the number of types contained in a tuple.
- class mlir.extras.types.Type(cast_from_type: Type)¶
- property _CAPIPtr: object¶
Gets a capsule wrapping the
MlirType.
- static parse(asm: str, context: Context | None = None) Type¶
Parses the assembly form of a type.
Returns a Type object or raises an
MLIRErrorif the type cannot be parsed.
- __eq__(arg: Type, /) bool¶
- __eq__(other: object | None) bool
Compares type with non-type object (always returns False).
- __hash__() int¶
Returns the hash value of the
Type.
- dump() None¶
Dumps a debug representation of the object to stderr.
- __str__() str¶
Returns the assembly form of the
Type.
- __repr__() str¶
Returns a string representation of the
Type.
- class mlir.extras.types.UnrankedMemRefType(cast_from_type: Type)¶
Bases:
ShapedType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(element_type: Type, memory_space: Attribute | None, loc: Location | None = None) UnrankedMemRefType¶
Create a unranked memref type
- static get_unchecked(element_type: Type, memory_space: Attribute | None, context: Context | None = None) UnrankedMemRefType¶
Create a unranked memref type
- class mlir.extras.types.UnrankedTensorType(cast_from_type: Type)¶
Bases:
ShapedType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(element_type: Type, loc: Location | None = None) UnrankedTensorType¶
Create a unranked tensor type
- static get_unchecked(element_type: Type, context: Context | None = None) UnrankedTensorType¶
Create a unranked tensor type
- class mlir.extras.types.VectorType(cast_from_type: Type)¶
Bases:
ShapedType- static_typeid: _mlir.ir.TypeID = Ellipsis¶
(arg: object, /) -> _mlir.ir.TypeID
- property typeid: TypeID¶
Returns the
TypeIDof theType, or raisesValueErrorifTypehas noTypeID.
- __repr__() str¶
Returns a string representation of the
Type.
- type_name: str = Ellipsis¶
(arg: object, /) -> str
- static get(shape: collections.abc.Sequence[int], element_type: Type, *, scalable: collections.abc.Sequence | None = None, scalable_dims: collections.abc.Sequence[int] | None = None, loc: Location | None = None) VectorType¶
Create a vector type
- static get_unchecked(shape: collections.abc.Sequence[int], element_type: Type, *, scalable: collections.abc.Sequence | None = None, scalable_dims: collections.abc.Sequence[int] | None = None, context: Context | None = None) VectorType¶
Create a vector type
- property scalable: bool¶
- property scalable_dims: list[bool]¶
- mlir.extras.types.index¶
- mlir.extras.types.i(width)¶
- mlir.extras.types.si(width)¶
- mlir.extras.types.ui(width)¶
- mlir.extras.types.bool¶
- mlir.extras.types.i8¶
- mlir.extras.types.i16¶
- mlir.extras.types.i32¶
- mlir.extras.types.i64¶
- mlir.extras.types.si8¶
- mlir.extras.types.si16¶
- mlir.extras.types.si32¶
- mlir.extras.types.si64¶
- mlir.extras.types.ui8¶
- mlir.extras.types.ui16¶
- mlir.extras.types.ui32¶
- mlir.extras.types.ui64¶
- mlir.extras.types.f16¶
- mlir.extras.types.f32¶
- mlir.extras.types.tf32¶
- mlir.extras.types.f64¶
- mlir.extras.types.bf16¶
- mlir.extras.types.f8E5M2¶
- mlir.extras.types.f8E4M3¶
- mlir.extras.types.f8E4M3FN¶
- mlir.extras.types.f8E4M3B11FNUZ¶
- mlir.extras.types.f8E3M4¶
- mlir.extras.types.f4E2M1FN¶
- mlir.extras.types.f6E2M3FN¶
- mlir.extras.types.f6E3M2FN¶
- mlir.extras.types.f8E8M0FNU¶
- mlir.extras.types.f8E5M3FNU¶
- mlir.extras.types.none¶
- mlir.extras.types.complex(type)¶
- mlir.extras.types.opaque(dialect_namespace, type_data)¶
- mlir.extras.types._shaped(*shape, element_type: mlir.ir.Type = None, type_constructor=None)¶
- mlir.extras.types.vector(*shape, element_type: mlir.ir.Type = None, scalable: List[bool] | None = None, scalable_dims: List[int] | None = None)¶
- mlir.extras.types.tensor(*shape, element_type: mlir.ir.Type = None, encoding: str | None = None)¶
- mlir.extras.types.memref(*shape, element_type: mlir.ir.Type = None, memory_space: int | None = None, layout: mlir.ir.StridedLayoutAttr | None = None)¶
- mlir.extras.types.tuple(*elements)¶
- mlir.extras.types.function(*, inputs, results)¶