class
TensorLifetime
PythonTensor operator lifetime.
TensorLifetime()Tensor operator lifetime.
Provisional: importable, but outside the compatibility promise; a minor release can change or remove it.
attribute
tensor_id
Pythontensor_id: TensorId = Field(..., description='Unique identifier for the tensor')Unique identifier for the tensor
attribute
start_op
Pythonstart_op: int = Field(..., description='Index of the first operator that uses/defines it')Index of the first operator that uses/defines it
attribute
end_op
Pythonend_op: int = Field(..., description='Index of the last operator that uses it')Index of the last operator that uses it
method
add_op
PythonAdd an operator index to the lifetime.
add_op(op_idx: int)Add an operator index to the lifetime.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
op_idx | int | Required | Operator index to add |
method
merge
PythonMerge another lifetime into this one.
merge(other: TensorLifetime)Merge another lifetime into this one.
This updates the start and end operators to encompass both lifetimes. Useful when tensors have aliases.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
other | TensorLifetime | Required | Another tensor lifetime to merge |