Class HostTensor (mod)
Functions for creating and operating on tensors stored in host memory.
Inheritance
Namespace: Tensor
Assembly: Tensor.dll
Syntax
module HostTensor
Remarks
This module contains functions for creating tensors stored in host memory. It further contains functions that only work with tensors stored in host memory. Calling these functions with tensors stored on other devices will result in an System.InvalidOperationException.
Examples
let x = HostTensor.zeros [3L; 3L] // x.Dev = HostTensor.Dev
Fields
Name | Description |
---|---|
val Dev | Tensor device using a .NET array in host memory as data storage. |
Methods
Name | Description |
---|---|
val arange: 'T -> 'T -> 'T -> Tensor<'T> | Creates a new vector filled with equaly spaced values using a specifed increment. |
val counting: int64 -> Tensor<int64> | Creates a new vector filled with the integers from zero to the specified maximum. |
val empty: int -> Tensor<'T> | Creates a new, empty tensor with the given number of dimensions. |
val falses: int64 list -> Tensor<bool> | Creates a new boolean tensor filled with falses. |
val Fill: Tensor<'T> -> unit -> 'T -> unit | Fills the tensor with the values returned by the function. |
val filled: int64 list -> 'T -> Tensor<'T> | Creates a new tensor filled with the specified value. |
val FillFoldAxis: Tensor<'T> -> 'T -> 'TA -> 'T -> Tensor<'T> -> int -> Tensor<'TA> -> unit | Applies to specified function to all elements of the tensor, threading an accumulator through the computation. |
val FillIndexed: Tensor<'T> -> int64 [] -> 'T -> unit | Fills the tensor with values returned by the specifed function. |
val FillMap: Tensor<'T> -> 'TA -> 'T -> Tensor<'TA> -> unit | Applies to specified function to all elements of the tensor using the specified tensor as target. |
val FillMap2: Tensor<'T> -> 'TA -> 'TB -> 'T -> Tensor<'TA> -> Tensor<'TB> -> unit | Applies to specified function to all elements of the two tensors using the specified tensor as target. |
val FillMapIndexed: Tensor<'T> -> int64 [] -> 'TA -> 'T -> Tensor<'TA> -> unit | Applies to specified indexed function to all elements of the tensor using the specified tensor as target. |
val FillMapIndexed2: Tensor<'T> -> int64 [] -> 'TA -> 'TB -> 'T -> Tensor<'TA> -> Tensor<'TB> -> unit | Applies to specified indexed function to all elements of the two tensors using the specified tensor as target. |
val FillSeq: Tensor<'T> -> seq<'T> -> unit | Fills the tensor with the values returned by the given sequence. |
val foldAxis: 'T -> 'TA -> 'T -> Tensor<'T> -> int -> Tensor<'TA> -> Tensor<'T> | Applies to specified function to all elements of the tensor, threading an accumulator through the computation. |
val identity: int64 -> Tensor<'T> | Creates a new identity matrix. |
val init: int64 list -> int64 [] -> 'T -> Tensor<'T> | Creates a new tensor with values returned by the specified function. |
val linspace: 'T -> 'T -> int64 -> Tensor<'T> | Creates a new vector of given size filled with equaly spaced values. |
val map: 'T -> 'R -> Tensor<'T> -> Tensor<'R> | Applies to specified function to all elements of the tensor. |
val map2: 'TA -> 'TB -> 'R -> Tensor<'TA> -> Tensor<'TB> -> Tensor<'R> | Applies to specified function to all elements of the two tensors. |
val mapi: int64 [] -> 'T -> 'R -> Tensor<'T> -> Tensor<'R> | Applies to specified indexed function to all elements of the tensor. |
val mapi2: int64 [] -> 'TA -> 'TB -> 'R -> Tensor<'TA> -> Tensor<'TB> -> Tensor<'R> | Applies to specified indexed function to all elements of the two tensors. |
val ofArray: 'T [] -> Tensor<'T> | Creates a one-dimensional tensor copying the specified data. |
val ofArray2D: 'T [,] -> Tensor<'T> | Creates a two-dimensional tensor copying the specified data. |
val ofArray3D: 'T [,,] -> Tensor<'T> | Creates a three-dimensional tensor copying the specified data. |
val ofArray4D: 'T [,,,] -> Tensor<'T> | Creates a four-dimensional tensor copying the specified data. |
val ofList: 'T list -> Tensor<'T> | Creates a one-dimensional tensor from the specified list. |
val ofList2D: 'T list list -> Tensor<'T> | Creates a two-dimensional tensor from the specified list of lists. |
val ofSeq: seq<'T> -> Tensor<'T> | Creates a one-dimensional tensor from the specified sequence. |
val ofSeqWithShape: int64 list -> seq<'T> -> Tensor<'T> | Creates a one-dimensional Tensor using the specified sequence and shape. |
val ones: int64 list -> Tensor<'T> | Creates a new tensor filled with ones (1). |
val randomInt: Random -> int * int -> int64 list -> Tensor<int> | Creates a tensor filled with random integer numbers from a uniform distribution. |
val randomNormal: Random -> 'T * 'T -> int64 list -> Tensor<'T> | Creates a tensor filled with random numbers from a normale distribution. |
val randomUniform: Random -> 'T * 'T -> int64 list -> Tensor<'T> | Creates a tensor filled with random floating-point numbers from a uniform distribution. |
val read: HDF5 -> string -> Tensor<'T> | Reads a tensor from the specified HDF5 object path in an HDF5 file. |
val readUntyped: HDF5 -> string -> ITensor | Reads a tensor with unspecified data type from the specified HDF5 object path in an HDF5 file. |
val scalar: 'T -> Tensor<'T> | Creates a new zero-dimensional (scalar) tensor with the specified value. |
val toArray: Tensor<'T> -> 'T [] | Creates an array from a one-dimensional tensor. |
val toArray2D: Tensor<'T> -> 'T [,] | Creates an array from a two-dimensional tensor. |
val toArray3D: Tensor<'T> -> 'T [,,] | Creates an array from a three-dimensional tensor. |
val toArray4D: Tensor<'T> -> 'T [,,,] | Creates an array from a four-dimensional tensor. |
val toList: Tensor<'T> -> 'T list | Creates a list from a one-dimensional tensor. |
val toList2D: Tensor<'T> -> 'T list list | Creates a list of lists from a two-dimensional tensor. |
val toSeq: Tensor<'T> -> seq<'T> | A sequence of all elements contained in the tensor. |
val transfer: Tensor<'T> -> Tensor<'T> | Transfers a tensor to the host device. |
val trues: int64 list -> Tensor<bool> | Creates a new boolean tensor filled with trues. |
val usingArray: 'T [] -> Tensor<'T> | Creates a one-dimensional tensor referencing the specified data. |
val write: HDF5 -> string -> ITensor -> unit | Writes the tensor into the HDF5 file under the specfied HDF5 object path. |
val zeros: int64 list -> Tensor<'T> | Creates a new tensor filled with zeros (0). |