TensorTransform

abstract class TensorTransform<T : DType, V>(ctx: ExecutionContext) : Transform<Tensor<T, V>, Tensor<T, V>> (source)

A transform that operates on tensors using an ExecutionContext.

Tensor transforms need access to the execution context to perform operations like arithmetic, reshaping, and type conversion. This abstract class provides the common infrastructure for tensor-based transformations.

Parameters

T

The data type of the input and output tensors

V

The value type of the tensor elements

ctx

The execution context providing tensor operations

Inheritors

Constructors

Link copied to clipboard
constructor(ctx: ExecutionContext)

Functions

Link copied to clipboard
open override fun getOutputShape(inputShape: Shape): Shape

By default, tensor transforms preserve the input shape. Override this method if the transform changes the shape.