Runtime Tensor Iterators#
This tensor iterator allows Python programs to iterate over the values of a tensor. In the same way
that the RuntimeTensorX is defined, these iterators are defined here as PyTensorIteratorX,
where X is either F for single-precision real values, D is for double-precision real values,
C is for single-precision complex values, and Z is for double-precision complex values.
- class einsums.core.PyTensorIteratorX#
Iterator for tensors and tensor views.
Added in version 1.0.0.
- __next__()#
Get the next value in the tensor.
- Returns:
The next value in the tensor.
- Raises:
StopIteration – Raises this when there are no more values to give.
Added in version 1.0.0.
- __iter__()#
Get the iterator for this object.
- Returns:
Returns a copy of the object.
Added in version 1.0.0.
- __reversed__()#
Get the reverse iterators starting from the current position.
- Returns:
The reversed iterator.
Added in version 1.0.0.
- reversed() bool#
Gives whether the iterator goes forward or backwards.
- Returns:
Trueif the iterator is going in reverse,Falseif it is going forward.
Added in version 1.0.0.