API reference
python:astx:astx.tensor.TensorLiteral
class TensorLiteral
TensorLiteral(values: Sequence[astx.AST], *, element_type: astx.DataType, shape: Sequence[int], strides: Sequence[int] | None = None, offset_bytes: int = 0)
Source: packages/astx/src/astx/tensor.py:83
Internal Arrow C++ backed Tensor literal node.
Build one Arrow C++ tensor value from scalar values plus shape and stride metadata.
Attributes
-
values — Values to process, in order.; Type: list[astx.AST]
-
element_type — Type of each element.; Type: astx.DataType
-
shape — Declared dimensions or result shape.; Type: tuple[int, ...]
-
strides — Strides.; Type: tuple[int, ...] | None
-
offset_bytes — Offset bytes.; Type: int
-
type_ — Type associated with this expression.; Type: TensorType
-
loc — Type: SourceLocation
-
kind — Type: ASTKind
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
-
name — Type: str
-
_tmp_id — Type: int
Methods
-
__init__ — Initialize one Tensor literal.
-
get_struct — Return the structured representation of the Tensor literal.