API reference
python:astx:astx.TensorView
class TensorView
TensorView(base: astx.AST, *, shape: Sequence[int], strides: Sequence[int] | None = None, offset_bytes: int = 0)
Source: packages/astx/src/astx/tensor.py:152
Declared as: python:astx:astx.tensor.TensorView
Internal Tensor view node.
Build one shallow tensor view by reusing the base storage and replacing the logical shape, strides, and offset metadata.
Attributes
-
base — Base value or declaration.; Type: astx.AST
-
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 view.
-
get_struct — Return the structured representation of the Tensor view.