FloatTensor

abstract class FloatTensor : DTensor

Types

Companion
Link copied to clipboard
object Companion

Functions

all
Link copied to clipboard
open 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
abstract 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 fun impureMap(f: (Float) -> Float): FloatTensor

map for when the function is not pure.

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

zip for when the function is not pure.

impureZip2
Link copied to clipboard
open 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 fun map(f: (Float) -> Float): FloatTensor
mapIndexed
Link copied to clipboard
open fun mapIndexed(f: (Int, Float) -> Float): FloatTensor
normalize
Link copied to clipboard
open 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 fun zip(right: FloatTensor, f: (Float, Float) -> Float): FloatTensor
zip2
Link copied to clipboard
open 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
abstract 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
abstract 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.

Inheritors

FloatScalar
Link copied to clipboard
SparseFloatVector
Link copied to clipboard
SparseFloatTensor
Link copied to clipboard
SparseRowFloatTensor
Link copied to clipboard
StridedFloatTensor
Link copied to clipboard
GpuFloatScalar
Link copied to clipboard
GpuFloatTensor
Link copied to clipboard

Extensions

concat
Link copied to clipboard
fun FloatTensor.concat(right: FloatTensor, axis: Int = 0): FloatTensor
gather
Link copied to clipboard
fun FloatTensor.gather(indices: List<Int>, axis: Int, paddingIndex: Int = -1): FloatTensor
max
Link copied to clipboard
fun FloatTensor.max(axes: IntArray = allAxes, keepDims: Boolean = false): FloatTensor
min
Link copied to clipboard
fun FloatTensor.min(axes: IntArray = allAxes, keepDims: Boolean = false): FloatTensor
scatter
Link copied to clipboard
fun FloatTensor.scatter(indices: List<Int>, axis: Int, newShape: Shape, paddingIndex: Int = -1): FloatTensor
slice
Link copied to clipboard
fun FloatTensor.slice(start: Int, end: Int, axis: Int = 0): FloatTensor