FurnaceImage Type

Tensor operations

Static members

Static member Description

FurnaceImage.abs input

Full Usage: FurnaceImage.abs input

Parameters:
Returns: Tensor

Computes the element-wise absolute value of the given input tensor.

The tensor will have the same element type as the input tensor.

input : Tensor
Returns: Tensor

FurnaceImage.acos input

Full Usage: FurnaceImage.acos input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the arccosine of the elements of input.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.add (a, b)

Full Usage: FurnaceImage.add (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return the element-wise addition of the two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.arange (endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.arange (endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Parameters:
    endVal : int - The ending value for the set of points.
    ?startVal : int - The starting value for the set of points. Default: 0.
    ?step : int - The gap between each pair of adjacent points. Default: 1.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size \(\left\lceil \frac{\text{end} - \text{start}}{\text{step}} \right\rceil\) with values from the interval [start, end) taken with common difference step beginning from start.

endVal : int

The ending value for the set of points.

?startVal : int

The starting value for the set of points. Default: 0.

?step : int

The gap between each pair of adjacent points. Default: 1.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.arange (endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.arange (endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Parameters:
    endVal : float - The ending value for the set of points.
    ?startVal : float - The starting value for the set of points. Default: 0.
    ?step : float - The gap between each pair of adjacent points. Default: 1.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size \(\left\lceil \frac{\text{end} - \text{start}}{\text{step}} \right\rceil\) with values from the interval [start, end) taken with common difference step beginning from start.

Non-integer steps may be subject to floating point rounding errors when comparing against end.

endVal : float

The ending value for the set of points.

?startVal : float

The starting value for the set of points. Default: 0.

?step : float

The gap between each pair of adjacent points. Default: 1.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.arangeLike (input, endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.arangeLike (input, endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    endVal : int - The ending value for the set of points.
    ?startVal : int - The starting value for the set of points. Default: 0.
    ?step : int - The gap between each pair of adjacent points. Default: 1.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

A version of FurnaceImage.arange with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

endVal : int

The ending value for the set of points.

?startVal : int

The starting value for the set of points. Default: 0.

?step : int

The gap between each pair of adjacent points. Default: 1.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.arangeLike (input, endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.arangeLike (input, endVal, ?startVal, ?step, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    endVal : float - The ending value for the set of points.
    ?startVal : float - The starting value for the set of points. Default: 0.
    ?step : float - The gap between each pair of adjacent points. Default: 1.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

A version of FurnaceImage.arange with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

endVal : float

The ending value for the set of points.

?startVal : float

The starting value for the set of points. Default: 0.

?step : float

The gap between each pair of adjacent points. Default: 1.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.argmax (input, dim, ?keepDim)

Full Usage: FurnaceImage.argmax (input, dim, ?keepDim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the indices of the maximum value of all elements in the input tensor.

input : Tensor

The input tensor.

dim : int

The dimension.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.argmax input

Full Usage: FurnaceImage.argmax input

Parameters:
    input : Tensor - The input tensor.

Returns: int[]

Returns the indices of the maximum value of all elements in the input tensor.

input : Tensor

The input tensor.

Returns: int[]

FurnaceImage.argmin (input, dim, ?keepDim)

Full Usage: FurnaceImage.argmin (input, dim, ?keepDim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the indices of the minimum value of all elements in the input tensor.

input : Tensor

The input tensor.

dim : int

The dimension.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.argmin input

Full Usage: FurnaceImage.argmin input

Parameters:
    input : Tensor - The input tensor.

Returns: int[]

Returns the indices of the minimum value of all elements in the input tensor.

input : Tensor

The input tensor.

Returns: int[]

FurnaceImage.asin input

Full Usage: FurnaceImage.asin input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the arcsine of the elements of input.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.atan input

Full Usage: FurnaceImage.atan input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the arctangent of the elements of input.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.backends ()

Full Usage: FurnaceImage.backends ()

Returns: Backend list

Returns the list of available backends.

Returns: Backend list

FurnaceImage.backendsAndDevices ()

Full Usage: FurnaceImage.backendsAndDevices ()

Returns: (Backend * Device list) list

Returns the list of available backends and devices available for each backend.

Returns: (Backend * Device list) list

FurnaceImage.bceLoss (input, target, ?weight, ?reduction)

Full Usage: FurnaceImage.bceLoss (input, target, ?weight, ?reduction)

Parameters:
    input : Tensor - The input tensor.
    target : Tensor - The target tensor.
    ?weight : Tensor - A manual rescaling weight given to the loss of each batch element.
    ?reduction : string - Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

Creates a criterion that measures the Binary Cross Entropy between the target and the output

input : Tensor

The input tensor.

target : Tensor

The target tensor.

?weight : Tensor

A manual rescaling weight given to the loss of each batch element.

?reduction : string

Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

FurnaceImage.bernoulli (probs, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.bernoulli (probs, ?device, ?dtype, ?backend)

Parameters:
    probs : Tensor - The input tensor of probability values for the Bernoulli distribution.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Draws binary random numbers (0 or 1) from a Bernoulli distribution

probs : Tensor

The input tensor of probability values for the Bernoulli distribution.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.cast (input, dtype)

Full Usage: FurnaceImage.cast (input, dtype)

Parameters:
    input : Tensor - The input tensor.
    dtype : Dtype - The desired element type of returned tensor.

Returns: Tensor

Convert the tensor to one with the given element type.

If the element type is unchanged the input tensor will be returned.

input : Tensor

The input tensor.

dtype : Dtype

The desired element type of returned tensor.

Returns: Tensor

FurnaceImage.cat (tensors, ?dim)

Full Usage: FurnaceImage.cat (tensors, ?dim)

Parameters:
    tensors : Tensor seq - The sequence of tensors to concatenate.
    ?dim : int - The the dimension over which the tensors are concatenated.

Returns: Tensor

Concatenates the given sequence of seq tensors in the given dimension. All tensors must either have the same shape (except in the concatenating dimension) or be empty.

tensors : Tensor seq

The sequence of tensors to concatenate.

?dim : int

The the dimension over which the tensors are concatenated.

Returns: Tensor

FurnaceImage.ceil input

Full Usage: FurnaceImage.ceil input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the ceil of the elements of input, the smallest integer greater than or equal to each element.

The tensor will have the same element type as the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.clamp (input, ?low, ?high)

Full Usage: FurnaceImage.clamp (input, ?low, ?high)

Parameters:
    input : Tensor - The input tensor.
    ?low : scalar - The lower-bound of the range to be clamped to.
    ?high : scalar - The upper-bound of the range to be clamped to.

Returns: Tensor

Clamp all elements in input into the range [ low..high] and return a resulting tensor

input : Tensor

The input tensor.

?low : scalar

The lower-bound of the range to be clamped to.

?high : scalar

The upper-bound of the range to be clamped to.

Returns: Tensor

FurnaceImage.clone input

Full Usage: FurnaceImage.clone input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the same characteristics and storage cloned.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.config configuration

Full Usage: FurnaceImage.config configuration

Parameters:
    configuration : Device * Dtype * Backend * Printer - A tuple of the new default device, default element type, default backend, and default printer.

Configure the default device, element type, backend, printer. Only floating point dtypes are supported as the default.

configuration : Device * Dtype * Backend * Printer

A tuple of the new default device, default element type, default backend, and default printer.

FurnaceImage.config ()

Full Usage: FurnaceImage.config ()

Returns: Device * Dtype * Backend * Printer

Return the current default device, element type, backend, and printer.

Returns: Device * Dtype * Backend * Printer

FurnaceImage.config (?device, ?dtype, ?backend, ?printer)

Full Usage: FurnaceImage.config (?device, ?dtype, ?backend, ?printer)

Parameters:
    ?device : Device - The new default device.
    ?dtype : Dtype - The new default element type. Only floating point dtypes are supported as the default.
    ?backend : Backend - The new default backend.
    ?printer : Printer - The new default printer.

Configure the default device, dtype, and/or backend.

?device : Device

The new default device.

?dtype : Dtype

The new default element type. Only floating point dtypes are supported as the default.

?backend : Backend

The new default backend.

?printer : Printer

The new default printer.

FurnaceImage.conv1d (input, filters, ?stride, ?padding, ?dilation)

Full Usage: FurnaceImage.conv1d (input, filters, ?stride, ?padding, ?dilation)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?padding : int - The implicit paddings on both sides of the input.
    ?dilation : int - The spacing between kernel elements.

Returns: Tensor

Applies a 1D convolution over an input signal composed of several input planes

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?padding : int

The implicit paddings on both sides of the input.

?dilation : int

The spacing between kernel elements.

Returns: Tensor

FurnaceImage.conv2d (input, filters, ?stride, ?strides, ?padding, ?paddings, ?dilation, ?dilations)

Full Usage: FurnaceImage.conv2d (input, filters, ?stride, ?strides, ?padding, ?paddings, ?dilation, ?dilations)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?strides : int seq - The strides of the convolving kernel.
    ?padding : int - The implicit padding on corresponding sides of the input.
    ?paddings : int seq - The implicit paddings on corresponding sides of the input.
    ?dilation : int - The spacing between kernel elements.
    ?dilations : int seq - The spacings between kernel elements.

Returns: Tensor

Applies a 2D convolution over an input signal composed of several input planes

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?strides : int seq

The strides of the convolving kernel.

?padding : int

The implicit padding on corresponding sides of the input.

?paddings : int seq

The implicit paddings on corresponding sides of the input.

?dilation : int

The spacing between kernel elements.

?dilations : int seq

The spacings between kernel elements.

Returns: Tensor

FurnaceImage.conv3d (input, filters, ?stride, ?strides, ?padding, ?paddings, ?dilation, ?dilations)

Full Usage: FurnaceImage.conv3d (input, filters, ?stride, ?strides, ?padding, ?paddings, ?dilation, ?dilations)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?strides : int seq - The strides of the convolving kernel.
    ?padding : int - The implicit padding on corresponding sides of the input.
    ?paddings : int seq - The implicit paddings on corresponding sides of the input.
    ?dilation : int - The spacing between kernel elements.
    ?dilations : int seq - The spacings between kernel elements.

Returns: Tensor

Applies a 3D convolution over an input signal composed of several input planes

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?strides : int seq

The strides of the convolving kernel.

?padding : int

The implicit padding on corresponding sides of the input.

?paddings : int seq

The implicit paddings on corresponding sides of the input.

?dilation : int

The spacing between kernel elements.

?dilations : int seq

The spacings between kernel elements.

Returns: Tensor

FurnaceImage.convTranspose1d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding)

Full Usage: FurnaceImage.convTranspose1d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?padding : int - The implicit padding on both sides of the input.
    ?dilation : int - The spacing between kernel elements.
    ?outputPadding : int - The additional size added to one side of each dimension in the output shape.

Returns: Tensor

Applies a 1D transposed convolution operator over an input signal composed of several input planes, sometimes also called 'deconvolution'.

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?padding : int

The implicit padding on both sides of the input.

?dilation : int

The spacing between kernel elements.

?outputPadding : int

The additional size added to one side of each dimension in the output shape.

Returns: Tensor

FurnaceImage.convTranspose2d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding, ?strides, ?paddings, ?dilations, ?outputPaddings)

Full Usage: FurnaceImage.convTranspose2d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding, ?strides, ?paddings, ?dilations, ?outputPaddings)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?padding : int - The implicit padding on both sides of the input.
    ?dilation : int - The spacing between kernel elements.
    ?outputPadding : int - The additional size added to one side of each dimension in the output shape.
    ?strides : int seq - The strides of the convolving kernel.
    ?paddings : int seq - The implicit paddings on corresponding sides of the input.
    ?dilations : int seq - The spacings between kernel elements.
    ?outputPaddings : int seq - The additional sizes added to one side of each dimension in the output shape.

Returns: Tensor

Applies a 2D transposed convolution operator over an input signal composed of several input planes, sometimes also called 'deconvolution'.

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?padding : int

The implicit padding on both sides of the input.

?dilation : int

The spacing between kernel elements.

?outputPadding : int

The additional size added to one side of each dimension in the output shape.

?strides : int seq

The strides of the convolving kernel.

?paddings : int seq

The implicit paddings on corresponding sides of the input.

?dilations : int seq

The spacings between kernel elements.

?outputPaddings : int seq

The additional sizes added to one side of each dimension in the output shape.

Returns: Tensor

FurnaceImage.convTranspose3d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding, ?strides, ?paddings, ?dilations, ?outputPaddings)

Full Usage: FurnaceImage.convTranspose3d (input, filters, ?stride, ?padding, ?dilation, ?outputPadding, ?strides, ?paddings, ?dilations, ?outputPaddings)

Parameters:
    input : Tensor - The input tensor.
    filters : Tensor - The filters.
    ?stride : int - The stride of the convolving kernel.
    ?padding : int - The implicit padding on both sides of the input.
    ?dilation : int - The spacing between kernel elements.
    ?outputPadding : int - The additional size added to one side of each dimension in the output shape.
    ?strides : int seq - The strides of the convolving kernel.
    ?paddings : int seq - The implicit paddings on corresponding sides of the input.
    ?dilations : int seq - The spacings between kernel elements.
    ?outputPaddings : int seq - The additional sizes added to one side of each dimension in the output shape.

Returns: Tensor

Applies a 3D transposed convolution operator over an input signal composed of several input planes, sometimes also called 'deconvolution'.

input : Tensor

The input tensor.

filters : Tensor

The filters.

?stride : int

The stride of the convolving kernel.

?padding : int

The implicit padding on both sides of the input.

?dilation : int

The spacing between kernel elements.

?outputPadding : int

The additional size added to one side of each dimension in the output shape.

?strides : int seq

The strides of the convolving kernel.

?paddings : int seq

The implicit paddings on corresponding sides of the input.

?dilations : int seq

The spacings between kernel elements.

?outputPaddings : int seq

The additional sizes added to one side of each dimension in the output shape.

Returns: Tensor

FurnaceImage.corrcoef input

Full Usage: FurnaceImage.corrcoef input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor The correlation coefficient matrix \(R\) is computed from the covariance matrix Returns a square tensor representing the correlation coefficient matrix. Given a tensor with \(N\) variables \(X=[x_1,x_2,\ldots,x_N]\) the \(R_{i,j}\) entry on the correlation matrix is the correlation between \(x_i\) and \(x_j\).

Estimates the Pearson correlation coefficient matrix for the given tensor. The tensor's first dimension should index variables and the second dimension should index observations for each variable.

The correlation between variables \(x\) and \(y\) is \[cor(x,y)= \frac{\sum^{N}_{i = 1}(x_{i} - \mu_x)(y_{i} - \mu_y)}{\sigma_x \sigma_y (N ~-~1)}\] where \(\mu_x\) and \(\mu_y\) are the sample means and \(\sigma_x\) and \(\sigma_x\) are the sample standard deviations.

input : Tensor

The input tensor.

Returns: Tensor

The correlation coefficient matrix \(R\) is computed from the covariance matrix Returns a square tensor representing the correlation coefficient matrix. Given a tensor with \(N\) variables \(X=[x_1,x_2,\ldots,x_N]\) the \(R_{i,j}\) entry on the correlation matrix is the correlation between \(x_i\) and \(x_j\).

Example

 let x = FurnaceImage.tensor([-0.2678; -0.0908; -0.3766;  0.2780])
 let y = FurnaceImage.tensor([-0.5812;  0.1535;  0.2387;  0.2350])
 let xy = FurnaceImage.stack([x;y])
 FurnaceImage.corrcoef(xy)
val x: obj
val y: obj
val xy: obj
Evaluates to
 tensor([[1.0000, 0.3582],
         [0.3582, 1.0000]])

FurnaceImage.cos input

Full Usage: FurnaceImage.cos input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the cosine of the elements of input

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.cosh input

Full Usage: FurnaceImage.cosh input

Parameters:
Returns: Tensor

Returns a new tensor with the hyperbolic cosine of the elements of input.

input : Tensor
Returns: Tensor

FurnaceImage.cov (input, ?correction, ?fweights, ?aweights)

Full Usage: FurnaceImage.cov (input, ?correction, ?fweights, ?aweights)

Parameters:
    input : Tensor - The input tensor.
    ?correction : int64 - Difference between the sample size and the sample degrees of freedom. Defaults to 1 (Bessel's correction).
    ?fweights : Tensor - Frequency weights represent the number of times each observation was observed. Should be given as a tensor of integers. Defaults to no weights.
    ?aweights : Tensor - Relative importance weights, larger weights for observations that should have a larger effect on the estimate. Should be given as a tensor of floating point numbers. Defaults to no weights.

Returns: Tensor Returns a square tensor representing the covariance matrix. Given a tensor with \(N\) variables \(X=[x_1,x_2,\ldots,x_N]\) the \(C_{i,j}\) entry on the covariance matrix is the covariance between \(x_i\) and \(x_j\).

Estimates the covariance matrix of the given tensor. The tensor's first dimension should index variables and the second dimension should index observations for each variable.

If no weights are given, the covariance between variables \(x\) and \(y\) is \[cov(x,y)= \frac{\sum^{N}_{i = 1}(x_{i} - \mu_x)(y_{i} - \mu_y)}{N~-~\text{correction}}\] where \(\mu_x\) and \(\mu_y\) are the sample means. If there are fweights or aweights then the covariance is \[cov(x,y)=\frac{\sum^{N}_{i = 1}w_i(x_{i} - \mu_x^*)(y_{i} - \mu_y^*)}{\text{normalization factor}}\] where \(w\) is either fweights or aweights if one weight type is provided. If both weight types are provided \(w=\text{fweights}\times\text{aweights}\). \(\mu_x^* = \frac{\sum^{N}_{i = 1}w_ix_{i} }{\sum^{N}_{i = 1}w_i}\) is the weighted mean of variables. The normalization factor is \(\sum^{N}_{i=1} w_i\) if only fweights are provided or if aweights are provided and correction=0. Otherwise if aweights \(aw\) are provided the normalization factor is \(\sum^N_{i=1} w_i - \text{correction}\times\frac{\sum^N_{i=1} w_i aw_i}{\sum^N_{i=1} w_i}\)

input : Tensor

The input tensor.

?correction : int64

Difference between the sample size and the sample degrees of freedom. Defaults to 1 (Bessel's correction).

?fweights : Tensor

Frequency weights represent the number of times each observation was observed. Should be given as a tensor of integers. Defaults to no weights.

?aweights : Tensor

Relative importance weights, larger weights for observations that should have a larger effect on the estimate. Should be given as a tensor of floating point numbers. Defaults to no weights.

Returns: Tensor

Returns a square tensor representing the covariance matrix. Given a tensor with \(N\) variables \(X=[x_1,x_2,\ldots,x_N]\) the \(C_{i,j}\) entry on the covariance matrix is the covariance between \(x_i\) and \(x_j\).

Example

 let x = FurnaceImage.tensor([0.0;3.4;5.0])
 let y = FurnaceImage.tensor([1.0;2.3;-3.0])
 let xy = FurnaceImage.stack([x;y])
 xy.cov()
val x: obj
val y: obj
val xy: obj
Evaluates to
 tensor([[ 6.5200, -4.0100],
         [-4.0100,  7.6300]])

FurnaceImage.create count value

Full Usage: FurnaceImage.create count value

Parameters:
    count : int - The number of elements in the tensor.
    value : 'a - The initial value for each element of the tensor.

Returns: Tensor

Create a new 1D tensor using the given value for each element.

count : int

The number of elements in the tensor.

value : 'a

The initial value for each element of the tensor.

Returns: Tensor

FurnaceImage.crossEntropyLoss (input, target, ?weight, ?reduction)

Full Usage: FurnaceImage.crossEntropyLoss (input, target, ?weight, ?reduction)

Parameters:
    input : Tensor - The input tensor.
    target : Tensor - The target tensor.
    ?weight : Tensor - A optional manual rescaling weight given to the loss of each batch element.
    ?reduction : string - Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

This criterion combines logsoftmax and nllLoss in a single function

input : Tensor

The input tensor.

target : Tensor

The target tensor.

?weight : Tensor

A optional manual rescaling weight given to the loss of each batch element.

?reduction : string

Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

FurnaceImage.curl f x

Full Usage: FurnaceImage.curl f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.curldivergence f x

Full Usage: FurnaceImage.curldivergence f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.derivative tensor

Full Usage: FurnaceImage.derivative tensor

Parameters:
Returns: Tensor

Get the derivative value of the tensor.

tensor : Tensor
Returns: Tensor

FurnaceImage.devices (?backend, ?deviceType)

Full Usage: FurnaceImage.devices (?backend, ?deviceType)

Parameters:
    ?backend : Backend - Return information for this backend. Defaults to Backend.Default.
    ?deviceType : DeviceType - If given, only return devices for this device type.

Returns: Device list

Returns the list of available devices for a given backend.

?backend : Backend

Return information for this backend. Defaults to Backend.Default.

?deviceType : DeviceType

If given, only return devices for this device type.

Returns: Device list

FurnaceImage.diagonal (input, ?offset, ?dim1, ?dim2)

Full Usage: FurnaceImage.diagonal (input, ?offset, ?dim1, ?dim2)

Parameters:
    input : Tensor - The input tensor. Must be at least 2-dimensional.
    ?offset : int - Which diagonal to consider. Default: 0.
    ?dim1 : int - The first dimension with respect to which to take diagonal. Default: 0..
    ?dim2 : int - The second dimension with respect to which to take diagonal. Default: 1.

Returns: Tensor

Returns a tensor with the diagonal elements with respect to dim1 and dim2. The argument offset controls which diagonal to consider.

input : Tensor

The input tensor. Must be at least 2-dimensional.

?offset : int

Which diagonal to consider. Default: 0.

?dim1 : int

The first dimension with respect to which to take diagonal. Default: 0..

?dim2 : int

The second dimension with respect to which to take diagonal. Default: 1.

Returns: Tensor

FurnaceImage.diff f x

Full Usage: FurnaceImage.diff f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.diff2 f x

Full Usage: FurnaceImage.diff2 f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.diffn n f x

Full Usage: FurnaceImage.diffn n f x

Parameters:
Returns: Tensor

TBD

n : int
f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.dilate (input, dilations)

Full Usage: FurnaceImage.dilate (input, dilations)

Parameters:
    input : Tensor - The input tensor.
    dilations : int seq - The dilations to use.

Returns: Tensor

Dilate the tensor in using the given dilations in each corresponding dimension.

input : Tensor

The input tensor.

dilations : int seq

The dilations to use.

Returns: Tensor

FurnaceImage.div (a, b)

Full Usage: FurnaceImage.div (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return the element-wise division of the two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.divergence f x

Full Usage: FurnaceImage.divergence f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.dot (a, b)

Full Usage: FurnaceImage.dot (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Computes the dot product (inner product) of two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.dropout (input, ?p)

Full Usage: FurnaceImage.dropout (input, ?p)

Parameters:
    input : Tensor - The input tensor.
    ?p : double - The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

Randomly zeroes some of the elements of the input tensor with probability p using samples from a Bernoulli distribution

input : Tensor

The input tensor.

?p : double

The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

FurnaceImage.dropout2d (input, ?p)

Full Usage: FurnaceImage.dropout2d (input, ?p)

Parameters:
    input : Tensor - The input tensor.
    ?p : double - The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

Randomly zero out entire channels (a channel is a 2D feature map, e.g., the jj -th channel of the ii -th sample in the batched input is a 2D tensor \text{input}[i, j]input[i,j] ). Each channel will be zeroed out independently on every forward call with probability p using samples from a Bernoulli distribution

input : Tensor

The input tensor.

?p : double

The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

FurnaceImage.dropout3d (input, ?p)

Full Usage: FurnaceImage.dropout3d (input, ?p)

Parameters:
    input : Tensor - The input tensor.
    ?p : double - The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

Randomly zero out entire channels (a channel is a 3D feature map, e.g., the jj -th channel of the ii -th sample in the batched input is a 3D tensor \text{input}[i, j]input[i,j] ). Each channel will be zeroed out independently on every forward call with probability p using samples from a Bernoulli distribution.

input : Tensor

The input tensor.

?p : double

The probability of an element to be zeroed. Default: 0.5.

Returns: Tensor

FurnaceImage.empty (?device, ?dtype, ?backend)

Full Usage: FurnaceImage.empty (?device, ?dtype, ?backend)

Parameters:
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new empty tensor holding no data, for the given element type and configuration

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.empty (length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.empty (length, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new uninitialized tensor filled with arbitrary values for the given length, element type and configuration

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.empty (shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.empty (shape, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new uninitialized tensor filled with arbitrary values for the given shape, element type and configuration

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.eq (a, b)

Full Usage: FurnaceImage.eq (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Returns a boolean tensor for the element-wise equality comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.evalForwardDiff f x v

Full Usage: FurnaceImage.evalForwardDiff f x v

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor * Tensor

FurnaceImage.evalForwardDiffs f x v

Full Usage: FurnaceImage.evalForwardDiffs f x v

Parameters:
Returns: Tensor[]

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor[]
Returns: Tensor[]

FurnaceImage.evalReverseDiff f x

Full Usage: FurnaceImage.evalReverseDiff f x

Parameters:
Returns: Tensor * (Tensor -> Tensor)

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * (Tensor -> Tensor)

FurnaceImage.exp input

Full Usage: FurnaceImage.exp input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Applies the exp function element-wise.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.expand (input, shape)

Full Usage: FurnaceImage.expand (input, shape)

Parameters:
    input : Tensor - The input tensor.
    shape : int seq - The desired shape of returned tensor.

Returns: Tensor

Returns a new view of the input tensor with singleton dimensions expanded to a larger size

input : Tensor

The input tensor.

shape : int seq

The desired shape of returned tensor.

Returns: Tensor

FurnaceImage.expandAs (input, other)

Full Usage: FurnaceImage.expandAs (input, other)

Parameters:
    input : Tensor - The input tensor.
    other : Tensor - The result tensor has the same size as other.

Returns: Tensor

Expand the input tensor to the same size as other tensor

input : Tensor

The input tensor.

other : Tensor

The result tensor has the same size as other.

Returns: Tensor

FurnaceImage.eye (rows, ?cols, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.eye (rows, ?cols, ?device, ?dtype, ?backend)

Parameters:
    rows : int - The number of rows
    ?cols : int - The number of columns with default being n
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 2-D tensor with ones on the diagonal and zeros elsewhere.

rows : int

The number of rows

?cols : int

The number of columns with default being n

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.fcurl f x

Full Usage: FurnaceImage.fcurl f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fcurldivergence f x

Full Usage: FurnaceImage.fcurldivergence f x

Parameters:
Returns: Tensor * Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor * Tensor

FurnaceImage.fdiff f x

Full Usage: FurnaceImage.fdiff f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fdiff2 f x

Full Usage: FurnaceImage.fdiff2 f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fdiffn n f x

Full Usage: FurnaceImage.fdiffn n f x

Parameters:
Returns: Tensor * Tensor

TBD

n : int
f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fdivergence f x

Full Usage: FurnaceImage.fdivergence f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.ffdiffn n f x

Full Usage: FurnaceImage.ffdiffn n f x

Parameters:
Returns: Tensor[]

TBD

n : int
f : Tensor -> Tensor
x : Tensor
Returns: Tensor[]

FurnaceImage.fgrad f x

Full Usage: FurnaceImage.fgrad f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fgradhessian f x

Full Usage: FurnaceImage.fgradhessian f x

Parameters:
Returns: Tensor * Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor * Tensor

FurnaceImage.fgradhessianv f x v

Full Usage: FurnaceImage.fgradhessianv f x v

Parameters:
Returns: Tensor * Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor * Tensor * Tensor

FurnaceImage.fgradv f x v

Full Usage: FurnaceImage.fgradv f x v

Parameters:
Returns: Tensor * Tensor

TBD

The x and v tensors should have the same number of elements.

f : Tensor -> Tensor

TBD

x : Tensor

TBD

v : Tensor

TBD

Returns: Tensor * Tensor

FurnaceImage.fhessian f x

Full Usage: FurnaceImage.fhessian f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fhessianv f x v

Full Usage: FurnaceImage.fhessianv f x v

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor * Tensor

FurnaceImage.fjacobian f x

Full Usage: FurnaceImage.fjacobian f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.fjacobianTv f x v

Full Usage: FurnaceImage.fjacobianTv f x v

Parameters:
    f : Tensor -> Tensor - vector-to-vector function
    x : Tensor - Point at which the function f will be evaluated, it must have a single dimension.
    v : Tensor - Vector

Returns: Tensor * Tensor

Original value and transposed Jacobian-vector product of a vector-to-vector function `f`, at point `x`, along vector `v`

f : Tensor -> Tensor

vector-to-vector function

x : Tensor

Point at which the function f will be evaluated, it must have a single dimension.

v : Tensor

Vector

Returns: Tensor * Tensor

FurnaceImage.fjacobianv f x v

Full Usage: FurnaceImage.fjacobianv f x v

Parameters:
Returns: Tensor * Tensor

TBD

The x and v tensors should have the same number of elements.

f : Tensor -> Tensor

TBD

x : Tensor

TBD

v : Tensor

TBD

Returns: Tensor * Tensor

FurnaceImage.flaplacian f x

Full Usage: FurnaceImage.flaplacian f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.flatten (input, ?startDim, ?endDim)

Full Usage: FurnaceImage.flatten (input, ?startDim, ?endDim)

Parameters:
    input : Tensor - The input tensor.
    ?startDim : int - The first dim to flatten.
    ?endDim : int - The last dim to flatten.

Returns: Tensor

Flattens a contiguous range of dims in a tensor.

input : Tensor

The input tensor.

?startDim : int

The first dim to flatten.

?endDim : int

The last dim to flatten.

Returns: Tensor

FurnaceImage.flip (input, dims)

Full Usage: FurnaceImage.flip (input, dims)

Parameters:
    input : Tensor - The input tensor.
    dims : int seq - The axis to flip on.

Returns: Tensor

Reverse the order of a n-D tensor along given axis in dims

input : Tensor

The input tensor.

dims : int seq

The axis to flip on.

Returns: Tensor

FurnaceImage.floor input

Full Usage: FurnaceImage.floor input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the floor of the elements of input, the largest integer less than or equal to each element.

The tensor will have the same element type as the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.forwardDiff nestingTag derivative tensor

Full Usage: FurnaceImage.forwardDiff nestingTag derivative tensor

Parameters:
    nestingTag : uint32 - The level tag.
    derivative : Tensor - The derivative of the input.
    tensor : Tensor - The input.

Returns: Tensor

Produce a new tensor suitable for calculating the forward-mode derivative at the given level tag.

nestingTag : uint32

The level tag.

derivative : Tensor

The derivative of the input.

tensor : Tensor

The input.

Returns: Tensor

FurnaceImage.full (length, value, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.full (length, value, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    value : scalar - The scalar giving the the initial values for the tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor of the given length filled with value, for the given element type and configuration

length : int

The length of the returned tensor.

value : scalar

The scalar giving the the initial values for the tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.full (shape, value, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.full (shape, value, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    value : scalar - The scalar used to form the initial values for the tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor filled with the scalar value, for the given shape, element type and configuration

shape : int seq

The desired shape of returned tensor.

value : scalar

The scalar used to form the initial values for the tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.fullLike (input, value, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.fullLike (input, value, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    value : scalar - The scalar giving the the initial values for the tensor.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a new tensor filled with the given scalar value with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

value : scalar

The scalar giving the the initial values for the tensor.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.gather (input, dim, indices)

Full Usage: FurnaceImage.gather (input, dim, indices)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The axis along which to index.
    indices : Tensor - The the indices of elements to gather.

Returns: Tensor

Gathers values along an axis specified by dim.

input : Tensor

The input tensor.

dim : int

The axis along which to index.

indices : Tensor

The the indices of elements to gather.

Returns: Tensor

FurnaceImage.ge (a, b)

Full Usage: FurnaceImage.ge (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Returns a boolean tensor for the element-wise greater-than-or-equal comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.grad f x

Full Usage: FurnaceImage.grad f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.gradhessian f x

Full Usage: FurnaceImage.gradhessian f x

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor * Tensor

FurnaceImage.gradhessianv f x v

Full Usage: FurnaceImage.gradhessianv f x v

Parameters:
Returns: Tensor * Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor * Tensor

FurnaceImage.gradv f x v

Full Usage: FurnaceImage.gradv f x v

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor

FurnaceImage.gt (a, b)

Full Usage: FurnaceImage.gt (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Returns a boolean tensor for the element-wise greater-than comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.hasinf input

Full Usage: FurnaceImage.hasinf input

Parameters:
    input : Tensor - The input tensor.

Returns: bool

Returns a boolean indicating if any element of the tensor is infinite.

input : Tensor

The input tensor.

Returns: bool

FurnaceImage.hasnan input

Full Usage: FurnaceImage.hasnan input

Parameters:
    input : Tensor - The input tensor.

Returns: bool

Returns a boolean indicating if any element of the tensor is a not-a-number (NaN) value.

input : Tensor

The input tensor.

Returns: bool

FurnaceImage.hessian f x

Full Usage: FurnaceImage.hessian f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.hessianv f x v

Full Usage: FurnaceImage.hessianv f x v

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor

FurnaceImage.init count initializer

Full Usage: FurnaceImage.init count initializer

Parameters:
    count : int - The length of the tensor.
    initializer : int -> 'a - The function used to initialize each element.

Returns: Tensor

Create a new 1D tensor using the given initializer for each element.

count : int

The length of the tensor.

initializer : int -> 'a

The function used to initialize each element.

Returns: Tensor

FurnaceImage.init2d length1 length2 initializer

Full Usage: FurnaceImage.init2d length1 length2 initializer

Parameters:
    length1 : int - The length of the tensor in the first dimension.
    length2 : int - The length of the tensor in the second dimension.
    initializer : int -> int -> 'a - The function used to initialize each element.

Returns: Tensor

Create a new 2D tensor using the given initializer for each element.

length1 : int

The length of the tensor in the first dimension.

length2 : int

The length of the tensor in the second dimension.

initializer : int -> int -> 'a

The function used to initialize each element.

Returns: Tensor

FurnaceImage.init3d length1 length2 length3 initializer

Full Usage: FurnaceImage.init3d length1 length2 length3 initializer

Parameters:
    length1 : int - The length of the tensor in the 1st dimension.
    length2 : int - The length of the tensor in the 2nd dimension.
    length3 : int - The length of the tensor in the 3rd dimension.
    initializer : int -> int -> int -> 'a - The function used to initialize each element.

Returns: Tensor

Create a new 3D tensor using the given initializer for each element.

length1 : int

The length of the tensor in the 1st dimension.

length2 : int

The length of the tensor in the 2nd dimension.

length3 : int

The length of the tensor in the 3rd dimension.

initializer : int -> int -> int -> 'a

The function used to initialize each element.

Returns: Tensor

FurnaceImage.init4d length1 length2 length3 length4 initializer

Full Usage: FurnaceImage.init4d length1 length2 length3 length4 initializer

Parameters:
    length1 : int - The length of the tensor in the 1st dimension.
    length2 : int - The length of the tensor in the 2nd dimension.
    length3 : int - The length of the tensor in the 3rd dimension.
    length4 : int - The length of the tensor in the 4th dimension.
    initializer : int -> int -> int -> int -> 'a - The function used to initialize each element.

Returns: Tensor

Create a new 4D tensor using the given initializer for each element.

length1 : int

The length of the tensor in the 1st dimension.

length2 : int

The length of the tensor in the 2nd dimension.

length3 : int

The length of the tensor in the 3rd dimension.

length4 : int

The length of the tensor in the 4th dimension.

initializer : int -> int -> int -> int -> 'a

The function used to initialize each element.

Returns: Tensor

FurnaceImage.isBackendAvailable backend

Full Usage: FurnaceImage.isBackendAvailable backend

Parameters:
Returns: bool

Indicates if a given backend is available.

backend : Backend
Returns: bool

FurnaceImage.isCudaAvailable ?backend

Full Usage: FurnaceImage.isCudaAvailable ?backend

Parameters:
    ?backend : Backend - Return information for this backend. Defaults to Backend.Default.

Returns: bool

Indicates if CUDA is available for a given backend.

?backend : Backend

Return information for this backend. Defaults to Backend.Default.

Returns: bool

FurnaceImage.isDeviceAvailable (device, ?backend)

Full Usage: FurnaceImage.isDeviceAvailable (device, ?backend)

Parameters:
    device : Device - The requested device.
    ?backend : Backend - Return information for this backend. Defaults to Backend.Default.

Returns: bool

Indicates if a given device is available for a given backend.

device : Device

The requested device.

?backend : Backend

Return information for this backend. Defaults to Backend.Default.

Returns: bool

FurnaceImage.isDeviceTypeAvailable (deviceType, ?backend)

Full Usage: FurnaceImage.isDeviceTypeAvailable (deviceType, ?backend)

Parameters:
    deviceType : DeviceType - The requested device type.
    ?backend : Backend - Return information for this backend. Defaults to Backend.Default.

Returns: bool

Indicates if a given device type is available for a given backend.

deviceType : DeviceType

The requested device type.

?backend : Backend

Return information for this backend. Defaults to Backend.Default.

Returns: bool

FurnaceImage.isTensor value

Full Usage: FurnaceImage.isTensor value

Parameters:
    value : obj

Returns: bool

Indicates if an object is a tensor

value : obj
Returns: bool

FurnaceImage.isinf input

Full Usage: FurnaceImage.isinf input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a boolean tensor where each element indicates if the corresponding element in the input tensor is an infinity value.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.isnan input

Full Usage: FurnaceImage.isnan input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a boolean tensor where each element indicates if the corresponding element in the input tensor is a NaN (not-a-number) value.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.jacobian f x

Full Usage: FurnaceImage.jacobian f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.jacobianTv f x v

Full Usage: FurnaceImage.jacobianTv f x v

Parameters:
    f : Tensor -> Tensor - vector-to-vector function
    x : Tensor - Point at which the function f will be evaluated, it must have a single dimension.
    v : Tensor - Vector

Returns: Tensor

Transposed Jacobian-vector product of a vector-to-vector function `f`, at point `x`, along vector `v`

f : Tensor -> Tensor

vector-to-vector function

x : Tensor

Point at which the function f will be evaluated, it must have a single dimension.

v : Tensor

Vector

Returns: Tensor

FurnaceImage.jacobianv f x v

Full Usage: FurnaceImage.jacobianv f x v

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
v : Tensor
Returns: Tensor

FurnaceImage.laplacian f x

Full Usage: FurnaceImage.laplacian f x

Parameters:
Returns: Tensor

TBD

f : Tensor -> Tensor
x : Tensor
Returns: Tensor

FurnaceImage.le (a, b)

Full Usage: FurnaceImage.le (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return a boolean tensor for the element-wise less-than-or-equal comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.leakyRelu (input, ?negativeSlope)

Full Usage: FurnaceImage.leakyRelu (input, ?negativeSlope)

Parameters:
    input : Tensor - The input tensor.
    ?negativeSlope : float - Controls the angle of the negative slope. Default: 0.01.

Returns: Tensor

Applies the leaky rectified linear unit function element-wise

\[\text{LeakyReLU}(x) = \max(0, x) + \text{negative\_slope} * \min(0, x)\]

input : Tensor

The input tensor.

?negativeSlope : float

Controls the angle of the negative slope. Default: 0.01.

Returns: Tensor

FurnaceImage.like (input, value, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.like (input, value, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    value : obj - The .NET object giving the the initial values for the tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a new tensor based on the given .NET value with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

value : obj

The .NET object giving the the initial values for the tensor.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.linspace (startVal, endVal, steps, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.linspace (startVal, endVal, steps, ?device, ?dtype, ?backend)

Parameters:
    startVal : int - The starting value for the set of points.
    endVal : int - The ending value for the set of points.
    steps : int - The size of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size steps whose values are evenly spaced from startVal to endVal. The values are going to be: \( (\text{startVal}, \text{startVal} + \frac{\text{endVal} - \text{startVal}}{\text{steps} - 1}, \ldots, \text{startVal} + (\text{steps} - 2) * \frac{\text{endVal} - \text{startVal}}{\text{steps} - 1}, \text{endVal}) \)

startVal : int

The starting value for the set of points.

endVal : int

The ending value for the set of points.

steps : int

The size of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.linspace (startVal, endVal, steps, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.linspace (startVal, endVal, steps, ?device, ?dtype, ?backend)

Parameters:
    startVal : float - The starting value for the set of points.
    endVal : float - The ending value for the set of points.
    steps : int - The size of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size steps whose values are evenly spaced from startVal to endVal. The values are going to be: \( (\text{startVal}, \text{startVal} + \frac{\text{endVal} - \text{startVal}}{\text{steps} - 1}, \ldots, \text{startVal} + (\text{steps} - 2) * \frac{\text{endVal} - \text{startVal}}{\text{steps} - 1}, \text{endVal}) \)

startVal : float

The starting value for the set of points.

endVal : float

The ending value for the set of points.

steps : int

The size of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.load fileName

Full Usage: FurnaceImage.load fileName

Parameters:
    fileName : string

Returns: 'b

Loads an object from the given file using a bespoke binary format.

The format used may change from version to version of Furnace.

fileName : string
Returns: 'b

FurnaceImage.log input

Full Usage: FurnaceImage.log input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the natural logarithm of the elements of input.

\[y_{i} = \log_{e} (x_{i})\]

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.log10 input

Full Usage: FurnaceImage.log10 input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the logarithm to the base 10 of the elements of input.

\[y_{i} = \log_{10} (x_{i})\]

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.logsoftmax (input, dim)

Full Usage: FurnaceImage.logsoftmax (input, dim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - A dimension along which softmax will be computed.

Returns: Tensor

Applies a softmax followed by a logarithm.

input : Tensor

The input tensor.

dim : int

A dimension along which softmax will be computed.

Returns: Tensor

FurnaceImage.logspace (startVal, endVal, steps, ?baseVal, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.logspace (startVal, endVal, steps, ?baseVal, ?device, ?dtype, ?backend)

Parameters:
    startVal : int - The starting value for the set of points.
    endVal : int - The ending value for the set of points.
    steps : int - The size of the returned tensor.
    ?baseVal : int - The base of the logarithm. Default: 10.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size steps whose values are evenly spaced logarithmically from \(\text{baseVal}^{\text{startVal}}\) to \(\text{baseVal}^{\text{endVal}}\). The values are going to be: \( (\text{baseVal}^{\text{startVal}}, \text{baseVal}^{(\text{startVal} + \frac{\text{endVal} - \text{startVal}}{ \text{steps} - 1})}, \ldots, \text{baseVal}^{(\text{startVal} + (\text{steps} - 2) * \frac{\text{endVal} - \text{startVal}}{ \text{steps} - 1})}, \text{baseVal}^{\text{endVal}}) \)

startVal : int

The starting value for the set of points.

endVal : int

The ending value for the set of points.

steps : int

The size of the returned tensor.

?baseVal : int

The base of the logarithm. Default: 10.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.logspace (startVal, endVal, steps, ?baseVal, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.logspace (startVal, endVal, steps, ?baseVal, ?device, ?dtype, ?backend)

Parameters:
    startVal : float - The starting value for the set of points.
    endVal : float - The ending value for the set of points.
    steps : int - The size of the returned tensor.
    ?baseVal : float - The base of the logarithm. Default: 10.0.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a 1-D tensor of size steps whose values are evenly spaced logarithmically from \(\text{baseVal}^{\text{startVal}}\) to \(\text{baseVal}^{\text{endVal}}\). The values are going to be: \( (\text{baseVal}^{\text{startVal}}, \text{baseVal}^{(\text{startVal} + \frac{\text{endVal} - \text{startVal}}{ \text{steps} - 1})}, \ldots, \text{baseVal}^{(\text{startVal} + (\text{steps} - 2) * \frac{\text{endVal} - \text{startVal}}{ \text{steps} - 1})}, \text{baseVal}^{\text{endVal}}) \)

startVal : float

The starting value for the set of points.

endVal : float

The ending value for the set of points.

steps : int

The size of the returned tensor.

?baseVal : float

The base of the logarithm. Default: 10.0.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.logsumexp (input, dim, ?keepDim)

Full Usage: FurnaceImage.logsumexp (input, dim, ?keepDim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to reduce.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Applies a logsumexp followed by a logarithm.

input : Tensor

The input tensor.

dim : int

The dimension to reduce.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.lt (a, b)

Full Usage: FurnaceImage.lt (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Returns a boolean tensor for the element-wise less-than comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.map mapping tensor

Full Usage: FurnaceImage.map mapping tensor

Parameters:
    mapping : Tensor -> Tensor - The function to apply to each element of the tensor.
    tensor : Tensor - The input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all elements of the input tensor.

mapping : Tensor -> Tensor

The function to apply to each element of the tensor.

tensor : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.map2 mapping tensor1 tensor2

Full Usage: FurnaceImage.map2 mapping tensor1 tensor2

Parameters:
    mapping : Tensor -> Tensor -> Tensor - The function to apply to each element of the tensor.
    tensor1 : Tensor - The first input tensor.
    tensor2 : Tensor - The second input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all corresponding elements of two input tensors.

The shapes of the two tensors must be identical.

mapping : Tensor -> Tensor -> Tensor

The function to apply to each element of the tensor.

tensor1 : Tensor

The first input tensor.

tensor2 : Tensor

The second input tensor.

Returns: Tensor

FurnaceImage.map3 mapping tensor1 tensor2 tensor3

Full Usage: FurnaceImage.map3 mapping tensor1 tensor2 tensor3

Parameters:
    mapping : Tensor -> Tensor -> Tensor -> Tensor - The function to apply to each element of the tensor.
    tensor1 : Tensor - The first input tensor.
    tensor2 : Tensor - The second input tensor.
    tensor3 : Tensor - The third input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all corresponding elements of three input tensors.

The shapes of the three tensors must be identical.

mapping : Tensor -> Tensor -> Tensor -> Tensor

The function to apply to each element of the tensor.

tensor1 : Tensor

The first input tensor.

tensor2 : Tensor

The second input tensor.

tensor3 : Tensor

The third input tensor.

Returns: Tensor

FurnaceImage.mapi mapping tensor

Full Usage: FurnaceImage.mapi mapping tensor

Parameters:
    mapping : int[] -> Tensor -> Tensor - The function is passed the index of each element. The function to apply to each element of the tensor.
    tensor : Tensor - The input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all elements of the input tensor.

mapping : int[] -> Tensor -> Tensor

The function is passed the index of each element. The function to apply to each element of the tensor.

tensor : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.mapi2 mapping tensor1 tensor2

Full Usage: FurnaceImage.mapi2 mapping tensor1 tensor2

Parameters:
    mapping : int[] -> Tensor -> Tensor -> Tensor - The function to apply to each element of the tensor.
    tensor1 : Tensor - The first input tensor.
    tensor2 : Tensor - The second input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all corresponding elements of two input tensors.

The function is passed the index of each element. The shapes of the two tensors must be identical.

mapping : int[] -> Tensor -> Tensor -> Tensor

The function to apply to each element of the tensor.

tensor1 : Tensor

The first input tensor.

tensor2 : Tensor

The second input tensor.

Returns: Tensor

FurnaceImage.mapi3 mapping tensor1 tensor2 tensor3

Full Usage: FurnaceImage.mapi3 mapping tensor1 tensor2 tensor3

Parameters:
    mapping : int[] -> Tensor -> Tensor -> Tensor -> Tensor - The function to apply to each element of the tensor.
    tensor1 : Tensor - The first input tensor.
    tensor2 : Tensor - The second input tensor.
    tensor3 : Tensor - The third input tensor.

Returns: Tensor

Produce a new tensor by mapping a function over all corresponding elements of three input tensors.

The function is passed the index of each element. The shapes of the three tensors must be identical.

mapping : int[] -> Tensor -> Tensor -> Tensor -> Tensor

The function to apply to each element of the tensor.

tensor1 : Tensor

The first input tensor.

tensor2 : Tensor

The second input tensor.

tensor3 : Tensor

The third input tensor.

Returns: Tensor

FurnaceImage.matmul (a, b)

Full Usage: FurnaceImage.matmul (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Matrix product of two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.max (a, dim, ?keepDim)

Full Usage: FurnaceImage.max (a, dim, ?keepDim)

Parameters:
    a : Tensor - The tensor.
    dim : int - The dimension.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the maximum value of all elements in the input tensor along the given dimension.

a : Tensor

The tensor.

dim : int

The dimension.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.max (a, b)

Full Usage: FurnaceImage.max (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Each element of the tensor input is compared with the corresponding element of the tensor other and an element-wise maximum is taken.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.max input

Full Usage: FurnaceImage.max input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the maximum value of all elements in the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.maxpool1d (input, kernelSize, ?stride, ?padding)

Full Usage: FurnaceImage.maxpool1d (input, kernelSize, ?stride, ?padding)

Parameters:
    input : Tensor - The input tensor.
    kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.

Returns: Tensor

Applies a 1D max pooling over an input signal composed of several input planes.

input : Tensor

The input tensor.

kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

Returns: Tensor

FurnaceImage.maxpool1di (input, kernelSize, ?stride, ?padding)

Full Usage: FurnaceImage.maxpool1di (input, kernelSize, ?stride, ?padding)

Parameters:
    input : Tensor - The input tensor.
    kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.

Returns: Tensor * Tensor

Applies a 1D max pooling over an input signal composed of several input planes, returning the max indices along with the outputs.

input : Tensor

The input tensor.

kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

Returns: Tensor * Tensor

FurnaceImage.maxpool2d (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Full Usage: FurnaceImage.maxpool2d (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Parameters:
    input : Tensor - The input tensor.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSize.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.

Returns: Tensor

Applies a 2D max pooling over an input signal composed of several input planes.

input : Tensor

The input tensor.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSize.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

Returns: Tensor

FurnaceImage.maxpool2di (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Full Usage: FurnaceImage.maxpool2di (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Parameters:
    input : Tensor - The input tensor.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSize.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.

Returns: Tensor * Tensor

Applies a 2D max pooling over an input signal composed of several input planes, returning the max indices along with the outputs.

input : Tensor

The input tensor.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSize.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

Returns: Tensor * Tensor

FurnaceImage.maxpool3d (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Full Usage: FurnaceImage.maxpool3d (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Parameters:
    input : Tensor - The input tensor.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSizes.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.

Returns: Tensor

Applies a 3D max pooling over an input signal composed of several input planes.

input : Tensor

The input tensor.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSizes.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

Returns: Tensor

FurnaceImage.maxpool3di (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Full Usage: FurnaceImage.maxpool3di (input, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings)

Parameters:
    input : Tensor - The input tensor.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSize.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.

Returns: Tensor * Tensor

Applies a 3D max pooling over an input signal composed of several input planes, returning the max indices along with the outputs.

input : Tensor

The input tensor.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSize.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

Returns: Tensor * Tensor

FurnaceImage.maxunpool1d (input, indices, kernelSize, ?stride, ?padding, ?outputSize)

Full Usage: FurnaceImage.maxunpool1d (input, indices, kernelSize, ?stride, ?padding, ?outputSize)

Parameters:
    input : Tensor - The input tensor.
    indices : Tensor - The indices selected by maxpool1di.
    kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?outputSize : int seq - The targeted output size.

Returns: Tensor

Computes a partial inverse of maxpool1di

input : Tensor

The input tensor.

indices : Tensor

The indices selected by maxpool1di.

kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?outputSize : int seq

The targeted output size.

Returns: Tensor

FurnaceImage.maxunpool2d (input, indices, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings, ?outputSize)

Full Usage: FurnaceImage.maxunpool2d (input, indices, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings, ?outputSize)

Parameters:
    input : Tensor - The input tensor.
    indices : Tensor - The indices selected by maxpool2di.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSizes.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.
    ?outputSize : int seq - The targeted output size.

Returns: Tensor

Computes a partial inverse of maxpool2di

input : Tensor

The input tensor.

indices : Tensor

The indices selected by maxpool2di.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSizes.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

?outputSize : int seq

The targeted output size.

Returns: Tensor

FurnaceImage.maxunpool3d (input, indices, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings, ?outputSize)

Full Usage: FurnaceImage.maxunpool3d (input, indices, ?kernelSize, ?stride, ?padding, ?kernelSizes, ?strides, ?paddings, ?outputSize)

Parameters:
    input : Tensor - The input tensor.
    indices : Tensor - The indices selected by maxpool3di.
    ?kernelSize : int - The size of the window to take a max over.
    ?stride : int - The stride of the window. Default value is kernelSize.
    ?padding : int - The implicit zero padding to be added on both sides.
    ?kernelSizes : int seq - The sizes of the window to take a max over.
    ?strides : int seq - The strides of the window. Default value is kernelSizes.
    ?paddings : int seq - The implicit zero paddings to be added on corresponding sides.
    ?outputSize : int seq - The targeted output size.

Returns: Tensor

Computes a partial inverse of maxpool3di

input : Tensor

The input tensor.

indices : Tensor

The indices selected by maxpool3di.

?kernelSize : int

The size of the window to take a max over.

?stride : int

The stride of the window. Default value is kernelSize.

?padding : int

The implicit zero padding to be added on both sides.

?kernelSizes : int seq

The sizes of the window to take a max over.

?strides : int seq

The strides of the window. Default value is kernelSizes.

?paddings : int seq

The implicit zero paddings to be added on corresponding sides.

?outputSize : int seq

The targeted output size.

Returns: Tensor

FurnaceImage.mean (input, dim, ?keepDim)

Full Usage: FurnaceImage.mean (input, dim, ?keepDim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to reduce.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the mean value of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them.

If keepdim is true, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s).

input : Tensor

The input tensor.

dim : int

The dimension to reduce.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.mean input

Full Usage: FurnaceImage.mean input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the mean value of all elements in the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.min (a, dim, ?keepDim)

Full Usage: FurnaceImage.min (a, dim, ?keepDim)

Parameters:
    a : Tensor - The tensor.
    dim : int - The dimension.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the minimum value of all elements in the input tensor along the given dimension.

a : Tensor

The tensor.

dim : int

The dimension.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.min (a, b)

Full Usage: FurnaceImage.min (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Each element of the tensor input is compared with the corresponding element of the tensor other and an element-wise minimum is taken.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.min input

Full Usage: FurnaceImage.min input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the minimum value of all elements in the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.move (input, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.move (input, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The input tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Move the tensor to a difference device, backend and/or change its element type.

If the characteristics are unchanged the input tensor will be returned.

input : Tensor

The input tensor.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.mseLoss (input, target, ?reduction)

Full Usage: FurnaceImage.mseLoss (input, target, ?reduction)

Parameters:
    input : Tensor - The input tensor.
    target : Tensor - The target tensor.
    ?reduction : string - Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

Creates a criterion that measures the mean squared error (squared L2 norm) between each element in the input and the target.

input : Tensor

The input tensor.

target : Tensor

The target tensor.

?reduction : string

Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

FurnaceImage.mul (a, b)

Full Usage: FurnaceImage.mul (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return the element-wise multiplication of the two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.multinomial (probs, numSamples, ?normalize, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.multinomial (probs, numSamples, ?normalize, ?device, ?dtype, ?backend)

Parameters:
    probs : Tensor - The input tensor containing probabilities.
    numSamples : int - The number of samples to draw.
    ?normalize : bool - Indicates where the probabilities should first be normalized by their sum.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor where each row contains numSamples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input.

probs : Tensor

The input tensor containing probabilities.

numSamples : int

The number of samples to draw.

?normalize : bool

Indicates where the probabilities should first be normalized by their sum.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.ne (a, b)

Full Usage: FurnaceImage.ne (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Returns a boolean tensor for the element-wise non-equality comparison of the elements in the two tensors.

The shapes of input and other don’t need to match, but they must be broadcastable.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.neg input

Full Usage: FurnaceImage.neg input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Return the element-wise negation of the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.nelement input

Full Usage: FurnaceImage.nelement input

Parameters:
    input : Tensor - The input tensor.

Returns: int

Returns the total number of elements in the input tensor.

input : Tensor

The input tensor.

Returns: int

FurnaceImage.nest level

Full Usage: FurnaceImage.nest level

Parameters:
    level : uint32 - The new nesting level.

Set the global nesting level for automatic differentiation.

level : uint32

The new nesting level.

FurnaceImage.nest ()

Full Usage: FurnaceImage.nest ()

Increase the global nesting level for automatic differentiation.

FurnaceImage.nestLevel ()

Full Usage: FurnaceImage.nestLevel ()

Returns: uint32

Get the global nesting level for automatic differentiation.

Returns: uint32

FurnaceImage.nestReset ()

Full Usage: FurnaceImage.nestReset ()

Reset the global nesting level for automatic differentiation to zero.

FurnaceImage.nllLoss (input, target, ?weight, ?reduction)

Full Usage: FurnaceImage.nllLoss (input, target, ?weight, ?reduction)

Parameters:
    input : Tensor - The input tensor.
    target : Tensor - The target tensor.
    ?weight : Tensor - A optional manual rescaling weight given to the loss of each batch element.
    ?reduction : string - Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

The negative log likelihood loss.

input : Tensor

The input tensor.

target : Tensor

The target tensor.

?weight : Tensor

A optional manual rescaling weight given to the loss of each batch element.

?reduction : string

Optionally specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'.

Returns: Tensor

FurnaceImage.noDiff tensor

Full Usage: FurnaceImage.noDiff tensor

Parameters:
    tensor : Tensor - The input.

Returns: Tensor

Produce a new constant (non-differentiated) tensor.

tensor : Tensor

The input.

Returns: Tensor

FurnaceImage.normalize input

Full Usage: FurnaceImage.normalize input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Normalizes a vector so all the values are between zero and one (min-max scaling to 0..1).

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.one (?device, ?dtype, ?backend)

Full Usage: FurnaceImage.one (?device, ?dtype, ?backend)

Parameters:
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Get the scalar '1' tensor for the given configuration

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.oneLike (input, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.oneLike (input, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns the '0' scalar tensor with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.onehot (length, hot, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.onehot (length, hot, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    hot : int - The location to set to 1.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a one-hot tensor, with one location set to 1, and all others 0.

length : int

The length of the returned tensor.

hot : int

The location to set to 1.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.onehotLike (input, length, hot, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.onehotLike (input, length, hot, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    length : int - The length of the returned tensor.
    hot : int - The location to set to 1.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

A version of FurnaceImage.onehot with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

length : int

The length of the returned tensor.

hot : int

The location to set to 1.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.ones (length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.ones (length, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor of the given length filled with '1' values for the given element type and configuration

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.ones (shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.ones (shape, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor filled with '1' values for the given shape, element type and configuration

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.onesLike (input, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.onesLike (input, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a new tensor filled with '1' values with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.pad (input, paddings)

Full Usage: FurnaceImage.pad (input, paddings)

Parameters:
    input : Tensor - The input tensor.
    paddings : int seq - The implicit paddings on corresponding sides of the input.

Returns: Tensor

Add zero padding to each side of a tensor

input : Tensor

The input tensor.

paddings : int seq

The implicit paddings on corresponding sides of the input.

Returns: Tensor

FurnaceImage.permute (input, permutation)

Full Usage: FurnaceImage.permute (input, permutation)

Parameters:
    input : Tensor - The input tensor.
    permutation : int seq - The desired ordering of dimensions.

Returns: Tensor

Returns the original tensor with its dimensions permuted.

input : Tensor

The input tensor.

permutation : int seq

The desired ordering of dimensions.

Returns: Tensor

FurnaceImage.pow (a, b)

Full Usage: FurnaceImage.pow (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return the element-wise exponentiation of the two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.primal tensor

Full Usage: FurnaceImage.primal tensor

Parameters:
Returns: Tensor

Get the primal value of the tensor.

tensor : Tensor
Returns: Tensor

FurnaceImage.primalDerivative tensor

Full Usage: FurnaceImage.primalDerivative tensor

Parameters:
Returns: Tensor * Tensor

Get the primal and derivative values of the tensor.

tensor : Tensor
Returns: Tensor * Tensor

FurnaceImage.rand (length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.rand (length, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1)

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.rand (shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.rand (shape, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1)

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.randLike (input, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randLike (input, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1) with characteristics based on the input tensor

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.randint (low, high, length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randint (low, high, length, ?device, ?dtype, ?backend)

Parameters:
    low : int - Lowest integer to be drawn from the distribution. Default: 0..
    high : int - One above the highest integer to be drawn from the distribution.
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).

low : int

Lowest integer to be drawn from the distribution. Default: 0..

high : int

One above the highest integer to be drawn from the distribution.

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.randint (low, high, shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randint (low, high, shape, ?device, ?dtype, ?backend)

Parameters:
    low : int - Lowest integer to be drawn from the distribution. Default: 0..
    high : int - One above the highest integer to be drawn from the distribution.
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).

low : int

Lowest integer to be drawn from the distribution. Default: 0..

high : int

One above the highest integer to be drawn from the distribution.

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.randintLike (input, low, high, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randintLike (input, low, high, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    low : int - Lowest integer to be drawn from the distribution. Default: 0..
    high : int - One above the highest integer to be drawn from the distribution.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

low : int

Lowest integer to be drawn from the distribution. Default: 0..

high : int

One above the highest integer to be drawn from the distribution.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.randn (length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randn (length, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.randn (shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randn (shape, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.randnLike (input, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.randnLike (input, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution) with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.relu input

Full Usage: FurnaceImage.relu input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Applies the rectified linear unit function element-wise.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.repeat (input, dim, times)

Full Usage: FurnaceImage.repeat (input, dim, times)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension along which to repeat values.
    times : int - The number of repetitions for each element.

Returns: Tensor

Repeat elements of a tensor

input : Tensor

The input tensor.

dim : int

The dimension along which to repeat values.

times : int

The number of repetitions for each element.

Returns: Tensor

FurnaceImage.reverse value tensor

Full Usage: FurnaceImage.reverse value tensor

Parameters:
    value : Tensor - The value to apply.
    tensor : Tensor - The output tensor.

Compute the reverse-mode derivative at the given output tensor.

value : Tensor

The value to apply.

tensor : Tensor

The output tensor.

FurnaceImage.reverseDiff nestingTag tensor

Full Usage: FurnaceImage.reverseDiff nestingTag tensor

Parameters:
    nestingTag : uint32 - The level tag.
    tensor : Tensor - The output tensor.

Returns: Tensor

Produce a new tensor suitable for calculating the reverse-mode derivative at the given level tag.

nestingTag : uint32

The level tag.

tensor : Tensor

The output tensor.

Returns: Tensor

FurnaceImage.reversePush value tensor

Full Usage: FurnaceImage.reversePush value tensor

Parameters:
    value : Tensor - The value to apply.
    tensor : Tensor - The output tensor.

Push the given value as part of the reverse-mode computation at the given output tensor.

value : Tensor

The value to apply.

tensor : Tensor

The output tensor.

FurnaceImage.reverseReset tensor

Full Usage: FurnaceImage.reverseReset tensor

Parameters:
    tensor : Tensor - The output tensor.

Reset the reverse mode computation associated with the given output tensor.

tensor : Tensor

The output tensor.

FurnaceImage.round input

Full Usage: FurnaceImage.round input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with each of the elements of input rounded to the closest integer.

The tensor will have the same element type as the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.safelog (input, ?epsilon)

Full Usage: FurnaceImage.safelog (input, ?epsilon)

Parameters:
    input : Tensor - The input tensor.
    ?epsilon : float - The smallest value a tensor element can take before the logarithm is applied. Default: 1e-12

Returns: Tensor

Returns the logarithm of the tensor after clamping the tensor so that all its elements are greater than epsilon. This is to avoid a -inf result for elements equal to zero.

input : Tensor

The input tensor.

?epsilon : float

The smallest value a tensor element can take before the logarithm is applied. Default: 1e-12

Returns: Tensor

FurnaceImage.save (value, fileName)

Full Usage: FurnaceImage.save (value, fileName)

Parameters:
    value : obj
    fileName : string

Saves the object to the given file using a bespoke binary format.

The format used may change from version to version of Furnace.

value : obj
fileName : string

FurnaceImage.scalar (value, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.scalar (value, ?device, ?dtype, ?backend)

Parameters:
    value : scalar - The scalar giving the the initial values for the tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new scalar tensor with the value value, for the given element type and configuration

value : scalar

The scalar giving the the initial values for the tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.scatter (input, dim, indices, destinationShape)

Full Usage: FurnaceImage.scatter (input, dim, indices, destinationShape)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The axis along which to index.
    indices : Tensor - The the indices of elements to gather.
    destinationShape : int seq - The destination shape.

Returns: Tensor

Gathers values along an axis specified by dim.

input : Tensor

The input tensor.

dim : int

The axis along which to index.

indices : Tensor

The the indices of elements to gather.

destinationShape : int seq

The destination shape.

Returns: Tensor

FurnaceImage.seed ?seed

Full Usage: FurnaceImage.seed ?seed

Parameters:
    ?seed : int

Seeds all backends with the given random seed, or a new seed based on the current time if no seed is specified.

?seed : int

FurnaceImage.sigmoid input

Full Usage: FurnaceImage.sigmoid input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Applies the sigmoid element-wise function

\[\text{Sigmoid}(x) = \frac{1}{1 + \exp(-x)}\]

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.sign input

Full Usage: FurnaceImage.sign input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the signs of the elements of input.

The tensor will have the same element type as the input tensor.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.sin input

Full Usage: FurnaceImage.sin input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the sine of the elements of input

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.sinh input

Full Usage: FurnaceImage.sinh input

Parameters:
Returns: Tensor

Returns a new tensor with the hyperbolic sine of the elements of input.

input : Tensor
Returns: Tensor

FurnaceImage.slice (input, index)

Full Usage: FurnaceImage.slice (input, index)

Parameters:
    input : Tensor - The input tensor.
    index : int seq - Index describing the slice.

Returns: Tensor

Get a slice of a tensor

input : Tensor

The input tensor.

index : int seq

Index describing the slice.

Returns: Tensor

FurnaceImage.softmax (input, dim)

Full Usage: FurnaceImage.softmax (input, dim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - A dimension along which softmax will be computed.

Returns: Tensor

Applies a softmax function.

Softmax is defined as: \text{Softmax}(x_{i}) = \frac{\exp(x_i)}{\sum_j \exp(x_j)}.

input : Tensor

The input tensor.

dim : int

A dimension along which softmax will be computed.

Returns: Tensor

FurnaceImage.softplus input

Full Usage: FurnaceImage.softplus input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Applies the softplus function element-wise.

\[\text{Softplus}(x) = \frac{1}{\beta} * \log(1 + \exp(\beta * x))\]

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.split (input, sizes, ?dim)

Full Usage: FurnaceImage.split (input, sizes, ?dim)

Parameters:
    input : Tensor - The tensor to split.
    sizes : int seq - The size of a single chunk or list of sizes for each chunk.
    ?dim : int - The dimension along which to split the tensor.

Returns: Tensor[]

Splits the tensor into chunks. The tensor will be split into sizes.Length chunks each with a corresponding size in the given dimension.

input : Tensor

The tensor to split.

sizes : int seq

The size of a single chunk or list of sizes for each chunk.

?dim : int

The dimension along which to split the tensor.

Returns: Tensor[]

FurnaceImage.sqrt input

Full Usage: FurnaceImage.sqrt input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the square-root of the elements of input.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.squeeze (input, ?dim)

Full Usage: FurnaceImage.squeeze (input, ?dim)

Parameters:
    input : Tensor - The input tensor.
    ?dim : int - If given, the input will be squeezed only in this dimension.

Returns: Tensor

Returns a tensor with all the dimensions of input of size 1 removed.

If the tensor has a batch dimension of size 1, then squeeze(input) will also remove the batch dimension, which can lead to unexpected errors.

input : Tensor

The input tensor.

?dim : int

If given, the input will be squeezed only in this dimension.

Returns: Tensor

FurnaceImage.stack (tensors, ?dim)

Full Usage: FurnaceImage.stack (tensors, ?dim)

Parameters:
    tensors : Tensor seq - The sequence of tensors to concatenate.
    ?dim : int - The dimension to insert. Has to be between 0 and the number of dimensions of concatenated tensors (inclusive).

Returns: Tensor

Concatenates sequence of tensors along a new dimension

All tensors need to be of the same size.

tensors : Tensor seq

The sequence of tensors to concatenate.

?dim : int

The dimension to insert. Has to be between 0 and the number of dimensions of concatenated tensors (inclusive).

Returns: Tensor

FurnaceImage.standardize input

Full Usage: FurnaceImage.standardize input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the tensor after standardization (z-score normalization)

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.std (input, dim, ?keepDim, ?unbiased)

Full Usage: FurnaceImage.std (input, dim, ?keepDim, ?unbiased)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to reduce.
    ?keepDim : bool - Whether the output tensor has dim retained or not.
    ?unbiased : bool - Whether to use the unbiased estimation or not.

Returns: Tensor

Returns the standard deviation of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them.

If keepdim is true, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s). If unbiased is False, then the standard deviation will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.

input : Tensor

The input tensor.

dim : int

The dimension to reduce.

?keepDim : bool

Whether the output tensor has dim retained or not.

?unbiased : bool

Whether to use the unbiased estimation or not.

Returns: Tensor

FurnaceImage.std (input, ?unbiased)

Full Usage: FurnaceImage.std (input, ?unbiased)

Parameters:
    input : Tensor - The input tensor.
    ?unbiased : bool - Whether to use the unbiased estimation or not.

Returns: Tensor

Returns the standard deviation of all elements in the input tensor.

If unbiased is False, then the standard deviation will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.

input : Tensor

The input tensor.

?unbiased : bool

Whether to use the unbiased estimation or not.

Returns: Tensor

FurnaceImage.sub (a, b)

Full Usage: FurnaceImage.sub (a, b)

Parameters:
    a : Tensor - The first tensor.
    b : Tensor - The second tensor.

Returns: Tensor

Return the element-wise subtraction of the two tensors.

a : Tensor

The first tensor.

b : Tensor

The second tensor.

Returns: Tensor

FurnaceImage.sum (input, dim, ?keepDim)

Full Usage: FurnaceImage.sum (input, dim, ?keepDim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to reduce.
    ?keepDim : bool - Whether the output tensor has dim retained or not.

Returns: Tensor

Returns the sum of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them.

If keepdim is true, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s).

input : Tensor

The input tensor.

dim : int

The dimension to reduce.

?keepDim : bool

Whether the output tensor has dim retained or not.

Returns: Tensor

FurnaceImage.sum input

Full Usage: FurnaceImage.sum input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the sum of all elements in the input tensor

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.tan input

Full Usage: FurnaceImage.tan input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the tangent of the elements of input

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.tanh input

Full Usage: FurnaceImage.tanh input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a new tensor with the hyperbolic tangent of the elements of input.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.tensor (value, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.tensor (value, ?device, ?dtype, ?backend)

Parameters:
    value : obj - The .NET object used to form the initial values for the tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Creates a new tensor from the given data, using the given element type and configuration.

The data is converted from arrays, sequences, lists and tuples of primitive values to a tensor whose shape is inferred from the data. The fastest creation technique is a one dimensional array matching the desired dtype. Then use 'view' to reshape.

value : obj

The .NET object used to form the initial values for the tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor
Example

    let t1 = FurnaceImage.tensor [ 1 .. 10 ]
    let t2 = FurnaceImage.tensor [ [ 1.0; 3.0; 4.0 ];
                             [ 1.02; 3.04; 4.01 ] ]
val t1: obj
val t2: obj

FurnaceImage.toImage (input, ?pixelMin, ?pixelMax, ?normalize, ?gridCols)

Full Usage: FurnaceImage.toImage (input, ?pixelMin, ?pixelMax, ?normalize, ?gridCols)

Parameters:
    input : Tensor - The input tensor.
    ?pixelMin : double - The minimum pixel value.
    ?pixelMax : double - The maximum pixel value.
    ?normalize : bool - If True, shift the image to the range (0, 1), by the min and max values specified by range.
    ?gridCols : int - Number of columns of images in the grid.

Returns: Tensor

Convert tensor to an image tensor with shape Channels x Height x Width

If the input tensor has 4 dimensions, then make a single image grid.

input : Tensor

The input tensor.

?pixelMin : double

The minimum pixel value.

?pixelMax : double

The maximum pixel value.

?normalize : bool

If True, shift the image to the range (0, 1), by the min and max values specified by range.

?gridCols : int

Number of columns of images in the grid.

Returns: Tensor

FurnaceImage.toImageString (input, ?pixelMin, ?pixelMax, ?normalize, ?gridCols, ?asciiPalette)

Full Usage: FurnaceImage.toImageString (input, ?pixelMin, ?pixelMax, ?normalize, ?gridCols, ?asciiPalette)

Parameters:
    input : Tensor - The input tensor.
    ?pixelMin : double - The minimum pixel value.
    ?pixelMax : double - The maximum pixel value.
    ?normalize : bool - If True, shift the image to the range (0, 1), by the min and max values specified by range.
    ?gridCols : int - Number of columns of images in the grid.
    ?asciiPalette : string - The ASCII pallette to use.

Returns: string

Convert tensor to a grayscale image tensor and return a string representation approximating grayscale values

input : Tensor

The input tensor.

?pixelMin : double

The minimum pixel value.

?pixelMax : double

The maximum pixel value.

?normalize : bool

If True, shift the image to the range (0, 1), by the min and max values specified by range.

?gridCols : int

Number of columns of images in the grid.

?asciiPalette : string

The ASCII pallette to use.

Returns: string

FurnaceImage.trace input

Full Usage: FurnaceImage.trace input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns the sum of the elements of the diagonal of the input 2-D matrix

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.transpose input

Full Usage: FurnaceImage.transpose input

Parameters:
    input : Tensor - The input tensor.

Returns: Tensor

Returns a tensor that is a transposed version of input with dimensions 0 and 1 swapped.

input : Tensor

The input tensor.

Returns: Tensor

FurnaceImage.transpose (input, dim0, dim1)

Full Usage: FurnaceImage.transpose (input, dim0, dim1)

Parameters:
    input : Tensor - The input tensor.
    dim0 : int - The first dimension to be transposed.
    dim1 : int - The second dimension to be transposed.

Returns: Tensor

Returns a tensor that is a transposed version of input. The given dimensions dim0 and dim1 are swapped.

input : Tensor

The input tensor.

dim0 : int

The first dimension to be transposed.

dim1 : int

The second dimension to be transposed.

Returns: Tensor

FurnaceImage.undilate (input, dilations)

Full Usage: FurnaceImage.undilate (input, dilations)

Parameters:
    input : Tensor - The input tensor.
    dilations : int seq - The dilations to use.

Returns: Tensor

Reverse the dilation of the tensor in using the given dilations in each corresponding dimension.

input : Tensor

The input tensor.

dilations : int seq

The dilations to use.

Returns: Tensor

FurnaceImage.unflatten (input, dim, unflattenedShape)

Full Usage: FurnaceImage.unflatten (input, dim, unflattenedShape)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to unflatten.
    unflattenedShape : int seq - New shape of the unflattened dimenension.

Returns: Tensor

Unflattens a tensor dimension by expanding it to the given shape.

input : Tensor

The input tensor.

dim : int

The dimension to unflatten.

unflattenedShape : int seq

New shape of the unflattened dimenension.

Returns: Tensor

FurnaceImage.unsqueeze (input, dim)

Full Usage: FurnaceImage.unsqueeze (input, dim)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The index at which to insert the singleton dimension.

Returns: Tensor

Returns a new tensor with a dimension of size one inserted at the specified position

input : Tensor

The input tensor.

dim : int

The index at which to insert the singleton dimension.

Returns: Tensor

FurnaceImage.unsqueezeAs (input, other)

Full Usage: FurnaceImage.unsqueezeAs (input, other)

Parameters:
    input : Tensor - The input tensor.
    other : Tensor - The other tensor.

Returns: Tensor

Returns a new tensor with dimensions of size one appended to the end until the number of dimensions is the same as the other tensor.

input : Tensor

The input tensor.

other : Tensor

The other tensor.

Returns: Tensor

FurnaceImage.unstack (input, ?dim)

Full Usage: FurnaceImage.unstack (input, ?dim)

Parameters:
    input : Tensor - The input tensor.
    ?dim : int - The dimension to remove.

Returns: Tensor[]

Removes a tensor dimension

input : Tensor

The input tensor.

?dim : int

The dimension to remove.

Returns: Tensor[]

FurnaceImage.var (input, dim, ?keepDim, ?unbiased)

Full Usage: FurnaceImage.var (input, dim, ?keepDim, ?unbiased)

Parameters:
    input : Tensor - The input tensor.
    dim : int - The dimension to reduce.
    ?keepDim : bool - Whether the output tensor has dim retained or not.
    ?unbiased : bool - Whether to use the unbiased estimation or not.

Returns: Tensor

Returns the variance of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them.

If keepdim is true, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s). If unbiased is False, then the variance will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.

input : Tensor

The input tensor.

dim : int

The dimension to reduce.

?keepDim : bool

Whether the output tensor has dim retained or not.

?unbiased : bool

Whether to use the unbiased estimation or not.

Returns: Tensor

FurnaceImage.var (input, ?unbiased)

Full Usage: FurnaceImage.var (input, ?unbiased)

Parameters:
    input : Tensor - The input tensor.
    ?unbiased : bool - Whether to use the unbiased estimation or not.

Returns: Tensor

Returns the variance of all elements in the input tensor.

If unbiased is False, then the variance will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.

input : Tensor

The input tensor.

?unbiased : bool

Whether to use the unbiased estimation or not.

Returns: Tensor

FurnaceImage.version

Full Usage: FurnaceImage.version

Returns: string

Returns the version of the Furnace.Core assembly.

Returns: string

FurnaceImage.view (input, shape)

Full Usage: FurnaceImage.view (input, shape)

Parameters:
    input : Tensor - The input tensor.
    shape : int - The desired shape of returned tensor.

Returns: Tensor

Returns a new tensor with the same data as the self tensor but of a different shape.

The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size. The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size and stride, i.e., each new view dimension must either be a subspace of an original dimension, or only span across original dimensions \(d, d+1, \dots, d+kd,d+1,…,d+k\) that satisfy the following contiguity-like condition that \(\forall i = d, \dots, d+k-1∀i=d,…,d+k−1 ,\) \[\text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1]\]

input : Tensor

The input tensor.

shape : int

The desired shape of returned tensor.

Returns: Tensor

FurnaceImage.view (input, shape)

Full Usage: FurnaceImage.view (input, shape)

Parameters:
    input : Tensor - The input tensor.
    shape : int seq - The desired shape of returned tensor.

Returns: Tensor

Returns a new tensor with the same data as the self tensor but of a different shape.

The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size. The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size and stride, i.e., each new view dimension must either be a subspace of an original dimension, or only span across original dimensions \(d, d+1, \dots, d+kd,d+1,…,d+k\) that satisfy the following contiguity-like condition that \(\forall i = d, \dots, d+k-1∀i=d,…,d+k−1 ,\) \[\text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1]\]

input : Tensor

The input tensor.

shape : int seq

The desired shape of returned tensor.

Returns: Tensor

FurnaceImage.viewAs (input, other)

Full Usage: FurnaceImage.viewAs (input, other)

Parameters:
    input : Tensor - The input tensor.
    other : Tensor - The result tensor has the same size as other.

Returns: Tensor

View this tensor as the same size as other.

The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size. The returned tensor shares the same data and must have the same number of elements, but may have a different size. For a tensor to be viewed, the new view size must be compatible with its original size and stride, i.e., each new view dimension must either be a subspace of an original dimension, or only span across original dimensions \(d, d+1, \dots, d+kd,d+1,…,d+k\) that satisfy the following contiguity-like condition that \(\forall i = d, \dots, d+k-1∀i=d,…,d+k−1 ,\) \[\text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1]\]

input : Tensor

The input tensor.

other : Tensor

The result tensor has the same size as other.

Returns: Tensor

FurnaceImage.zero (?device, ?dtype, ?backend)

Full Usage: FurnaceImage.zero (?device, ?dtype, ?backend)

Parameters:
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Get the scalar zero tensor for the given configuration

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.zeroCreate count

Full Usage: FurnaceImage.zeroCreate count

Parameters:
    count : int - The number of elements in the tensor.

Returns: Tensor

Create a new 1D tensor using '0' as value for each element.

count : int

The number of elements in the tensor.

Returns: Tensor

FurnaceImage.zeroLike (input, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.zeroLike (input, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns the '0' scalar tensor with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

FurnaceImage.zeros (length, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.zeros (length, ?device, ?dtype, ?backend)

Parameters:
    length : int - The length of the returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor filled with '0' values for the given length, element type and configuration

length : int

The length of the returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.zeros (shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.zeros (shape, ?device, ?dtype, ?backend)

Parameters:
    shape : int seq - The desired shape of returned tensor.
    ?device : Device - The desired device of returned tensor. Default: if None, uses Device.Default.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, uses Dtype.Default.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

Returns a new tensor filled with '0' values for the given shape, element type and configuration

shape : int seq

The desired shape of returned tensor.

?device : Device

The desired device of returned tensor. Default: if None, uses Device.Default.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, uses Dtype.Default.

?backend : Backend

The desired backend of returned tensor. Default: if None, uses Backend.Default.

Returns: Tensor

FurnaceImage.zerosLike (input, ?shape, ?device, ?dtype, ?backend)

Full Usage: FurnaceImage.zerosLike (input, ?shape, ?device, ?dtype, ?backend)

Parameters:
    input : Tensor - The shape and characteristics of input will determine those of the output tensor.
    ?shape : int seq - The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.
    ?device : Device - The desired device of returned tensor. Default: if None, the device of the input tensor is used.
    ?dtype : Dtype - The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.
    ?backend : Backend - The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

Returns a new tensor filled with '0' values with characteristics based on the input tensor.

input : Tensor

The shape and characteristics of input will determine those of the output tensor.

?shape : int seq

The desired shape of returned tensor. Default: If None, the shape of the input tensor is used.

?device : Device

The desired device of returned tensor. Default: if None, the device of the input tensor is used.

?dtype : Dtype

The desired element type of returned tensor. Default: if None, the element type of the input tensor is used.

?backend : Backend

The desired backend of returned tensor. Default: if None, the backend of the input tensor is used.

Returns: Tensor

© Copyright 2025, Furnace Contributors.