OpsBoundTensor

class OpsBoundTensor<T : DType, V>(val origin: Tensor<T, V>, opsRef: TensorOps) : Tensor<T, V> (source)

Lightweight wrapper that binds a Tensor to a specific TensorOps implementation. Useful to evaluate operator overloads with a desired backend (CPU/GPU/etc.).

Constructors

Link copied to clipboard
constructor(origin: Tensor<T, V>, opsRef: TensorOps)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val data: TensorData<T, V>

The data component responsible for storage, indexing, and memory management.

Link copied to clipboard
open override val dtype: KClass<T>

The data type descriptor defining the numerical precision and value representation.

Link copied to clipboard
open override val gradState: GradState<T, V>

Gradient state tied to this tensor instance.

Link copied to clipboard
open override val ops: TensorOps

The operations component responsible for computational algorithms and transformations.

Link copied to clipboard
val origin: Tensor<T, V>

Functions

Link copied to clipboard
open override fun accumulateGrad(g: Tensor<T, V>)

Accumulate a gradient tensor onto this tensor.

Link copied to clipboard
open override fun zeroGrad()

Reset accumulated gradient.