TensorData<T extends TypedData> extension

on

Methods

copy() Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Create a copy of this tensor with the same data and shape
copyElements(Tensor<T> input, Tensor<T> output, int count) Future<void>

Available on Tensor<T>, provided by the TensorData extension

Fast GPU-based element copy
copyWithPadding(Tensor<T> input, Tensor<T> output) Future<void>

Available on Tensor<T>, provided by the TensorData extension

fill(double value) Future<void>

Available on Tensor<T>, provided by the TensorData extension

Fill the entire tensor with a single value
getElement(List<int> indices) Future<double>

Available on Tensor<T>, provided by the TensorData extension

Returns the value of the tensor element at the given indices.
padTensorGPU(List<int> targetShape) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

GPU-based padding implementation
padTo(List<int> targetShape) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Pad tensor to output shape by adding zeros
reshape(List<int> newShape) Tensor<T>

Available on Tensor<T>, provided by the TensorData extension

Reshapes the tensor into a new shape without changing the underlying data.
reshapeView(List<int> newShape) Tensor<T>

Available on Tensor<T>, provided by the TensorData extension

Simplified reshape - just changes the shape view without changing data Only works if total elements match exactly
resize(List<int> targetShape) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Simple resize that creates a new tensor with the output shape Copies existing data and fills missing elements with zeros
setElement(List<int> indices, double value) Future<void>

Available on Tensor<T>, provided by the TensorData extension

Sets the value of the tensor element at the given indices to value.
slice({required List<int> startIndices, required List<int> endIndices}) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Slices the tensor based on multi-dimensional indices.
sliceLinear({required int start, required int end}) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Creates a new tensor by slicing the flattened tensor data. start is the starting flat index and end is the ending flat index (exclusive).
transpose({List<int>? axes}) Future<Tensor<T>>

Available on Tensor<T>, provided by the TensorData extension

Transposes the tensor according to the given axes permutation.