slice
Creates a tensor view using a direct list of slice descriptors.
This method provides a lower-level API for slicing when the slice descriptors are already available, bypassing the DSL builder. Useful for programmatic slice generation or integration with other systems.
Usage Example
val slices = listOf(
Slice.Range<MyDType, Float>(0, 10),
Slice.At<MyDType, Float>(5),
Slice.All<MyDType, Float>()
)
val view = tensor.slice(slices)Content copied to clipboard
Return
a TensorView providing sliced access to this tensor's data
Parameters
slices
the list of slice descriptors, one for each tensor dimension
Throws
if slice list doesn't match tensor rank
if any slice is invalid for its dimension