ForwardScalar

open class ForwardScalar : ForwardTensor, DScalar

A differentiable dual scalar (for forward derivatives)

Constructors

ForwardScalar
Link copied to clipboard
fun ForwardScalar(primal: DScalar, derivativeID: ForwardDerivativeID, tangent: DTensor)

Functions

get
Link copied to clipboard
open operator fun get(index: Int): DTensor
open operator fun get(vararg indices: Int): DTensor
toCodeString
Link copied to clipboard
open override fun toCodeString(): String
toString
Link copied to clipboard
open override fun toString(): String
wrap
Link copied to clipboard
open override fun wrap(wrapper: Wrapper): DTensor

Wrapper around the tensor

Properties

derivativeID
Link copied to clipboard
open override val derivativeID: ForwardDerivativeID

Each derivative is assigned a unique DerivativeID

indices
Link copied to clipboard
open val indices: Iterator<IntArray>

An iterator over the indices for the tensor

isScalar
Link copied to clipboard
open val isScalar: Boolean

True if the tensor is a scalar.

operations
Link copied to clipboard
open override val operations: Operations

The operations available on a tensor.

primal
Link copied to clipboard
open override val primal: DScalar

primal points to the actual tensor

rank
Link copied to clipboard
open val rank: Int

The number of dimensions in the tensor's shape. rank 0 - Scalar rank 1 - 1D array or 1D tensor rank 2 - 2D matrix or 2D tensor rank 3 - 3D tensor ... rank N - ND tensor

shape
Link copied to clipboard
open val shape: Shape

shape indicates the number of dimension of a tensor and the length of each dimension. If the shape of the tensor is 3x4x5 then the value of shape is Shape(3,4,5).

size
Link copied to clipboard
open val size: Int

The total number of elements of this tensor.

tangent
Link copied to clipboard
open var tangent: DTensor