Deep.Net


Tensor

Namespace: Tensor

An N-dimensional array with elements of type 'T.

Static members

Static memberDescription
allFinite(a)
Signature: a:Tensor<'T> -> bool
Type parameters: 'T

Returns true if all values in the tensor are finite (not NaN and not infinite).

almostEqual(a b)
Signature: a:Tensor<'T> -> b:Tensor<'T> -> bool
Type parameters: 'T

Returns true if two tensors have same (within machine precision) values in all elements. If tensors have different shape, then false is returned.

almostEqualWithTol(a, b, absTol, relTol)
Signature: (a:Tensor<'T> * b:Tensor<'T> * absTol:'T option * relTol:'T option) -> bool
Type parameters: 'T

Returns true if two tensors have same (within specified precision) values in all elements. If tensors have different shape, then false is returned.

arange(dev nElems)
Signature: dev:ITensorDevice -> nElems:int64 -> Tensor<int64>

Int64 vector containing the numbers [0L; 1L; ...; nElems-1L].

bool(a)
Signature: a:Tensor<'?182104> -> Tensor<bool>
Type parameters: '?182104

convert tensor data type to bool

byte(a)
Signature: a:Tensor<'?182106> -> Tensor<byte>
Type parameters: '?182106

convert tensor data type to byte

concat(ax ts)
Signature: ax:int -> ts:seq<Tensor<'T>> -> Tensor<'T>
Type parameters: 'T

Concatenates the sequence of tensors along the given axis.

diag(a)
Signature: a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Returns a view of the diagonal of a matrix as a vector. If the specified tensor has more than two dimensions, the diagonals along the last two dimensions are returned.

diagAxis(ax1 ax2 a)
Signature: ax1:int -> ax2:int -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Returns a view of the diagonal along the given axes. The diagonal replaces the first axis and the second axis is removed.

diagMat(a)
Signature: a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Creates a new matrix that has the specified diagonal. All other elements are zero. If the specified array has more than one dimension, the operation is performed batch-wise on the last dimension.

diagMatAxis(ax1 ax2 a)
Signature: ax1:int -> ax2:int -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Creates a new tensor of same shape but with ax2 inserted. The diagonal over ax1 and ax2 is filled with the elements of the original ax1. The other elements are set to zero.

diff(a)
Signature: a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

calculates the pairwise differences along the last axis

diffAxis(ax a)
Signature: ax:int -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

calculates the pairwise differences along the given axis

double(a)
Signature: a:Tensor<'?182128> -> Tensor<double>
Type parameters: '?182128

convert tensor data type to double

falses(dev shape)
Signature: dev:ITensorDevice -> (shape:int64 list) -> Tensor<bool>

Creates a new boolean tensor of given shape filled with false.

filled(dev shape value)
Signature: dev:ITensorDevice -> (shape:int64 list) -> value:'T -> Tensor<'T>
Type parameters: 'T

Creates a tensor filled with the specified value.

fillLinspace(start stop a)
Signature: start:^V -> stop:^V -> a:Tensor<^V> -> unit
Type parameters: ^V, ^?182095, ^?182096, ^?182097

Fills the vector with linearly spaced values from start to (including) stop.

float(a)
Signature: a:Tensor<'?182130> -> Tensor<float>
Type parameters: '?182130

convert tensor data type to float

float32(a)
Signature: a:Tensor<'?182132> -> Tensor<float32>
Type parameters: '?182132

convert tensor data type to float32

identity(dev size)
Signature: dev:ITensorDevice -> size:int64 -> Tensor<'T>
Type parameters: 'T

Identity matrix of given size.

init(dev shape fn)
Signature: dev:ITensorDevice -> (shape:int64 list) -> (fn:(int64 [] -> 'T)) -> Tensor<'T>
Type parameters: 'T

Creates a tensor with the values returned by the function.

int(a)
Signature: a:Tensor<'?182122> -> Tensor<int>
Type parameters: '?182122

convert tensor data type to int

int16(a)
Signature: a:Tensor<'?182110> -> Tensor<int16>
Type parameters: '?182110

convert tensor data type to int16

int32(a)
Signature: a:Tensor<'?182114> -> Tensor<int32>
Type parameters: '?182114

convert tensor data type to int32

int64(a)
Signature: a:Tensor<'?182118> -> Tensor<int64>
Type parameters: '?182118

convert tensor data type to int64

isClose(a b)
Signature: a:Tensor<'?182136> -> b:Tensor<'?182136> -> Tensor<bool>
Type parameters: '?182136

Element-wise check if two tensors have same (within machine precision) values. Checks for exact equality for non-floating-point types.

isCloseWithTol(a, b, absTol, relTol)
Signature: (a:Tensor<'T> * b:Tensor<'T> * absTol:'T option * relTol:'T option) -> Tensor<bool>
Type parameters: 'T

Element-wise check if two tensors have same (within machine precision) values. Checks for exact equality for non-floating-point types.

linspace(dev start stop nElems)
Signature: dev:ITensorDevice -> start:^V -> stop:^V -> nElems:int64 -> Tensor<^V>
Type parameters: ^V, ^e, ^f, ^g

Creates a one-dimensional tensor filled with linearly spaced values from start to (including) stop.

mean(a)
Signature: a:Tensor<'?182146> -> Tensor<'?182146>
Type parameters: '?182146

mean

meanAxis(axis a)
Signature: axis:int -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

mean over given axis

nativeint(a)
Signature: a:Tensor<'?182124> -> Tensor<nativeint>
Type parameters: '?182124

convert tensor data type to nativeint

NewOfType(shape, dataType, dev, order)
Signature: (shape:int64 list * dataType:Type * dev:ITensorDevice * order:TensorOrder option) -> ITensor

Creates a new tensor of the given shape and data type.

norm(a, ord)
Signature: (a:Tensor<'T> * ord:'T option) -> Tensor<'T>
Type parameters: 'T

tensor, matrix or vector norm of given order

normAxis(axis, a, ord)
Signature: (axis:int * a:Tensor<'T> * ord:'T option) -> Tensor<'T>
Type parameters: 'T

tensor, matrix or vector norm of given order over given axis

ofBlocks(bs)
Signature: bs:BlockTensor<'T> -> Tensor<'T>
Type parameters: 'T

tensor constructed of subtensors using a BlockTensor specification

ones(dev shape)
Signature: dev:ITensorDevice -> (shape:int64 list) -> Tensor<'T>
Type parameters: 'T

Creates a new tensor of given shape filled with ones.

onesLike(tmpl)
Signature: tmpl:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Tensor of same shape as specifed tensor and filled with ones.

replicate(ax reps a)
Signature: ax:int -> reps:int64 -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Replicates the tensor the given number of repetitions along the given axis.

sbyte(a)
Signature: a:Tensor<'?182108> -> Tensor<sbyte>
Type parameters: '?182108

convert tensor data type to sbyte

scalar(dev value)
Signature: dev:ITensorDevice -> value:'T -> Tensor<'T>
Type parameters: 'T

Creates a new tensor of scalar shape with the given value and storage.

scalarLike(tmpl value)
Signature: tmpl:ITensor -> value:'T -> Tensor<'T>
Type parameters: 'T

Creates a new tensor of scalar shape with the given value and same storage as the specified tensor.

single(a)
Signature: a:Tensor<'?182126> -> Tensor<single>
Type parameters: '?182126

convert tensor data type to single

std(a, ddof)
Signature: (a:Tensor<'?182154> * ddof:int64 option) -> Tensor<'?182154>
Type parameters: '?182154

standard deviation

stdAxis(ax, a, ddof)
Signature: (ax:int * a:Tensor<'?182152> * ddof:int64 option) -> Tensor<'?182152>
Type parameters: '?182152

standard deviation over given axis

tensorProduct(a b)
Signature: a:Tensor<'T> -> b:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

tensor product

trace(a)
Signature: a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Computes the trace of a matrix. If the specified tensor has more than two dimensions, the traces along the last two dimensions are returned.

traceAxis(ax1 ax2 a)
Signature: ax1:int -> ax2:int -> a:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Computes the traces along the given axes.

trues(dev shape)
Signature: dev:ITensorDevice -> (shape:int64 list) -> Tensor<bool>

Creates a new boolean tensor of given shape filled with true.

uint16(a)
Signature: a:Tensor<'?182112> -> Tensor<uint16>
Type parameters: '?182112

convert tensor data type to uint16

uint32(a)
Signature: a:Tensor<'?182116> -> Tensor<uint32>
Type parameters: '?182116

convert tensor data type to uint32

uint64(a)
Signature: a:Tensor<'?182120> -> Tensor<uint64>
Type parameters: '?182120

convert tensor data type to uint64

var(a, ddof)
Signature: (a:Tensor<'?182150> * ddof:int64 option) -> Tensor<'?182150>
Type parameters: '?182150

variances

varAxis(axis, a, ddof)
Signature: (axis:int * a:Tensor<'T> * ddof:int64 option) -> Tensor<'T>
Type parameters: 'T

variance over given axis

zeros(dev shape)
Signature: dev:ITensorDevice -> (shape:int64 list) -> Tensor<'T>
Type parameters: 'T

Creates a new tensor of given shape filled with zeros.

zerosLike(tmpl)
Signature: tmpl:Tensor<'T> -> Tensor<'T>
Type parameters: 'T

Tensor of same shape as specifed tensor and filled with zeros.

Fork me on GitHub