Data type of the tensor
Takes the absolute of each value of the tensor
Note that this can only be called on tensors with a signed data type (float*, int32, int16, int8)
Takes the arcus cosine of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the inverse hyperbolic cosine of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Align the shapes of this tensor and the given tensor according to the broadcasting rules: https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md
Tensor of which the shapes should be aligned
Takes the arcus sinus of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the inverse hyperbolic sinus of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the arcus tangens of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the inverse hyperbolic tangens of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Performs average pooling over the spatial dimensions of this tensor with shape [N,C,D1,D2,..]
Size of the average pooling dimension
Padding of the input specified as [startpad_D1,startpad_D2,...,startpad_DN,endpad_D1,endpad_D2,...] Padding value will be 0. Defaults to 0 for all axes
Stride size of the average pooling kernel. Defaults to 1 for all axes
Wether padded values should be included in the average (or masked out). Defaults to false
Rounds each tensor value to the nearest upper integer
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Clips the tensor values between the minimum and maximum
Minimum value. Defaults to the minimum possible value
Maximum value. Defaults to the maximum possible value
Compares this tensor to another tensor.
Tensor to compare to
Optional maximum difference between the tensors. If not specified the tensors have to be exactly equal
Constructs a tensor with the same shape and the given value everywhere
Convolves this tensor with the specified kernel.
This tensor should have shape [N,C,D1,D2,...] where D1,D2,... are the spatial dimensions.
Behaves according to https://github.com/onnx/onnx/blob/master/docs/Operators.md#Conv
Convolution kernel with shape [M,C/G,K1,K2] where G is the group parameter
Optional bias to add to the result with shape [M]
Per axis dilations for the spatial dimension. Defaults to 1 for all axes
Group parameter
Padding to add to the input for each spatial dimension. Defaults to 0 for all axes
Convolution stride for each spatial dimension. Defaults to 1 for all axes
Optional activation to apply. Defaults to the identity (so no activation)
Calculates the transpose convolution
This tensor should have shape [N,C,D1,D2,...] where D1,D2,... are the spatial dimensions.
Convolution kernel with shape [M,C/G,K1,K2] where G is the group parameter
Per axis dilations for the spatial dimension. Defaults to 1 for all axes
Group parameter
Padding to add to the input for each spatial dimension. Defaults to 0 for all axes
Convolution stride for each spatial dimension. Defaults to 1 for all axes
Copy the tensor. If the tensor is a GPU tensor, you can specify a precision (16/32)
Takes the cosine of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the hyperbolic cosine of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Deletes the tensor. Has the following effects depending on the backend of the tensor:
Takes the exponential of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Rounds each tensor value to the nearest lower integer
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Calculates the general matrix product. https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3
A and B can have batch dimensions. Their last two dimensions should correspond to the dimensions for the matrix product
Second matrix for the matrix product
If the last two dimensions of a are transposed. Defaults to false
If the last two dimensions of a are transposed. Defaults to false
Alpha parameter. Defaults to 1.0
Optional tensor to add to the result.
Beta parameter, only used if c is specified. Defaults to 1.0
Get the shape of the tensor
Gets the values of the tensor as a Float32 or Int32 Array
Computes the element wise hard sigmoid of all values given
by y = max(0, min(1, alpha * x + beta))
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the natural logarithm of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the maximum over specified axis/axes.
One or multiple axes to take the maximum over. If not specified this will be all axes
Wether the maximum axes will be kept with size 1
Takes the minimum over specified axis/axes.
One or multiple axes to take the minimum over. If not specified this will be all axes
Wether the minimum axes will be kept with size 1
Negates all entries of the tensor
Note that this can only be called on tensors with a signed data type (float*, int32, int16, int8)
Normalizes the tensor according to the following formula:
x' = (x-mean)/sqrt(variance + epsilon)
x'' = x'*scale + bias
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Pads the input according to the padding mode. The input has shape [D1,D2,..]
Padding size of each input. Specified as [startpad_D1,startpad_D2,...,startpad_DN,endpad_D1,endpad_D2,...]
Padding mode. One of 'constant', 'edge', 'reflect'. Defaults to 'constant'
Value for constant padding. Defaults to 0.0
Takes element wise power and multiplies with the given factor
Takes the product over specified axis/axes.
One or multiple axes to take the product over. If not specified this will be all axes
Wether the product axes will be kept with size 1
Takes the log of the sum over the specified axis
This is equal to a.sum(axes, keepDims).log()
(where sumSize is the number
of entries in the summation axes) but faster.
Note that this can only be called on tensors with a float data type (float64, float32, float16)
One or multiple axes to take the mean over. If not specified this will take the mean over all axes
Wether the mean axes will be kept with size 1
Takes the log of the sum over the exp of the specified axis
This is equal to a.sum(axes, keepDims).log()
(where sumSize is the number
of entries in the summation axes) but faster.
Note that this can only be called on tensors with a float data type (float64, float32, float16)
One or multiple axes to take the mean over. If not specified this will take the mean over all axes
Wether the mean axes will be kept with size 1
Takes the mean over the specified axis/axes.
This is equal to a.sum(axes, keepDims).divide(sumSize)
(where sumSize is the number
of entries in the summation axes) but faster.
One or multiple axes to take the mean over. If not specified this will take the mean over all axes
Wether the mean axes will be kept with size 1
Takes the mean over the specified axis/axes with the entries of the tensor squared.
This is equal to a.multiply(a).sum(axes, keepDims).divide(sumSize)
(where sumSize is the number
of entries in the summation axes) but faster.
One or multiple axes to take the mean over. If not specified this will take the mean over all axes
Wether the mean axes will be kept with size 1
Repeat the tensor along each dimension
Number of repetitions along each dimension
Reshape the tensor to the specified shape
At most one value in the shape can be -1, which will be replaced by the inferred size for this dimension.
New shape of the tensor
Wether the tensor values should be copied. Only has an effect on GPU tensors
Rounds each tensor value to the nearest integer. When the value is 0.5 it rounds up.
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Computes the element wise sigmoid of all values
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Computes the value-wise sign which is:
Note that this can only be called on tensors with a signed data type (float*, int32, int16, int8)
Takes the sinus of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Constructs a tensor with shape [1] and the given value everywhere
Takes the hyperbolic sinus of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes a slice of the tensor along the specified axes.
Start of the slice for each axis
End of the slice for each axis - Exclusive (the end index will not be included in the slice)
Axes to slice. Defaults to all axes
Takes the softmax along the given axis https://en.wikipedia.org/wiki/Softmax_function
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the square root of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Sums over the specified axis/axes.
One or multiple axes to sum over. If not specified this will sum over all axes
Wether the summation axes will be kept with size 1
Sums over the specified axis/axes with the entries of the tensor squared.
This is equal to a.multiply(a).sum(axes, keepDims)
but faster
One or multiple axes to sum over. If not specified this will sum over all axes
Wether the summation axes will be kept with size 1
Takes the tangens of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Takes the hyperbolic tangens of each value of the tensor
Note that this can only be called on tensors with a float data type (float64, float32, float16)
Transposes the tensor according to the given permutation
Permutation for the axes. Default is the reverse axis order
Scales the tensor up/down according to the specified scales. Uses nearest neighbor sampling
Generated using TypeDoc
Multi-dimensional array ala numpy.
A tensor is any multidimensional array. The number of dimensions is called the rank, and the size of all dimensions the shape.
here a has rank 2 and shape [2,3].
Tensors store values of a particular data type like floats or integers. The datatype can be accessed via the dtype property.
Many operations can be done on tensors. For fast execution, three different backends exist: