StridedFloatTensor

class StridedFloatTensor : FloatTensor

A float tensor, which stores its underlying data in a float array and tracks the strides needed to access data for each dimension.

Types

Companion
Link copied to clipboard
object Companion

Functions

all
Link copied to clipboard
open override fun all(p: (Float) -> Boolean): Boolean
asList
Link copied to clipboard
fun asList(): List<Float>
asStrided
Link copied to clipboard
fun asStrided(): StridedFloatTensor
at
Link copied to clipboard
open override fun at(pos: Int): Float
cpu
Link copied to clipboard
open fun cpu(): FloatTensor
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
get
Link copied to clipboard
open operator fun get(index: Int): DTensor
open operator fun get(vararg indices: Int): DTensor
gpu
Link copied to clipboard
fun gpu(): GpuFloatTensor
hashCode
Link copied to clipboard
open override fun hashCode(): Int
impureMap
Link copied to clipboard
open override fun impureMap(f: (Float) -> Float): StridedFloatTensor

map for when the function is not pure.

impureZip
Link copied to clipboard
open override fun impureZip(right: FloatTensor, f: (Float, Float) -> Float): FloatTensor

zip for when the function is not pure.

impureZip2
Link copied to clipboard
open override fun impureZip2(second: FloatTensor, third: FloatTensor, f: (Float, Float, Float) -> Float): FloatTensor

zip2 for when the function is not pure.

map
Link copied to clipboard
open override fun map(f: (Float) -> Float): StridedFloatTensor
mapIndexed
Link copied to clipboard
open fun mapIndexed(f: (Int, Float) -> Float): FloatTensor
normalize
Link copied to clipboard
open override fun normalize(): StridedFloatTensor

Return an equivalent tensor whose representation is a StridedFloatTensor with natural layout and zero offset (that is, with a contiguous data representation).

posToIndex
Link copied to clipboard
fun posToIndex(contig: Int): IntArray

Computes the tensor index corresponding to the position in normal form.

reduce
Link copied to clipboard
fun reduce(f: (Float, Float) -> Float, axes: IntArray = allAxes, keepDims: Boolean = false): FloatTensor
to
Link copied to clipboard
fun to(device: Device): FloatTensor
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

zip
Link copied to clipboard
open override fun zip(right: FloatTensor, f: (Float, Float) -> Float): FloatTensor
zip2
Link copied to clipboard
open override fun zip2(second: FloatTensor, third: FloatTensor, f: (Float, Float, Float) -> Float): FloatTensor

Properties

allAxes
Link copied to clipboard
val allAxes: IntArray
derivativeID
Link copied to clipboard
open override val derivativeID: DerivativeID

Each derivative is assigned a unique DerivativeID

device
Link copied to clipboard
val device: Device
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: DTensor

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 override 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.