SliceOp class

Slices tensor with Python-like syntax.

Each dimension can have an optional slice tuple (start, end, step). null values select the full range, similar to ":" in Python. Negative indices are supported, but step must be positive.

Inheritance

Constructors

SliceOp(List<(int?, int?, int?)?> slices)
Creates a slice operation with the given slices.
SliceOp.from(int dim, int start, {int step = 1})
Creates a slice from a specific start index to the end.
factory
SliceOp.range(int dim, int start, int end, {int step = 1})
Creates a slice for a range in a specific dimension.
factory
SliceOp.to(int dim, int end, {int step = 1})
Creates a slice from the beginning to a specific end index.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
The human-readable name of this operation.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slices List<(int?, int?, int?)?>
List of slice specifications for each dimension. null slice means select all elements in that dimension.
final

Methods

apply(TensorBuffer input) TensorBuffer
Applies this transform to input and returns the result.
override
call(TensorBuffer input) TensorBuffer
Alias for apply.
inherited
computeOutputShape(List<int> inputShape) List<int>
Computes the output shape for a given inputShape.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited