Basic Numerical Operations

Contents

Basic Numerical Operations#

Tensor Operators#

add(x, y[, dim_0, dim_1])

Elementwise addition: \(x + y\).

sub(x, y[, dim_0, dim_1])

Elementwise subtraction: \(x - y\).

mul(x, y[, dim_0, dim_1])

Elementwise multiply: \(x * y\).

div(x, y[, dim_0, dim_1])

Elementwise division: \(x / y\).

sum(x[, dim])

Sum of array elements along with the corresponding dim.

min(x[, dim])

Min value of the array elements along with the corresponding dim.

max(x[, dim])

Max value of the array elements along with the corresponding dim.

argmin(x[, dim])

Return the indices of the minimum of an array along the dim.

argmax(x[, dim])

Return the indices of the maximum of an array along the dim.

mean(x[, dim])

Mean value of the array elements along with the corresponding dim.

std(x[, dim])

The standard deviation of the array elements along with the corresponding dim.

var(x[, dim])

The variance of the array elements along with the corresponding dim.

sqrt(x)

Compute the non-negative square-root of the array elements, elementwise.

abs(x)

Compute the absolute values of an array, elementwise.

loge(x)

Perform the natural logarithm of an array, elementwise.

log10(x)

Perform the base-10 logarithm of an array, elementwise.

log2(x)

Perform the base-2 logarithm of an array, elementwise.

sin(x)

Perform sine of an array, elementwise.

cos(x)

Perform cosine of an array, elementwise.

tan(x)

Compute tangent of an array, elementwise.

arcsin(x)

Inverse sine of an array, elementwise.

arccos(x)

Inverse cosine of an array, elementwise.

arctan(x)

Inverse tan of an array, elementwise.

exp(x)

Calculate the exponent of an array, elementwise.

ceil(x)

Ceiling all elements of an array, elementwise.

floor(x)

flooring all elements of an array, elementwise.

sign(x)

Get each sign of an array, elementwise.

concatenate(arrays[, dim, device])

Concatenate all of the arrays along with the dim.

where(condition, true_array, false_array)

Return elements choosen from true_array or false_array depending on the condition

all(x)

Test whether all the elements in an array is true

any(x)

Test whether there is any element in an array is true

zeros(shape[, dtype, device_id])

Generate a new array with given shape and dtype, filled with zero

empty(shape[, dtype, device_id])

Generate a new array with given shape and dtype, without filling values

ones(shape[, dtype, device_id])

Generate a new array with given shape and dtype, filled with one

full(shape, fill_value[, dtype, device_id])

Generate a new array with given shape and dtype, filled with given 'fill_value'

uniform([low, high, size, dtype, device_id])

T(x[, dim])

dot(x, y[, dim_0, dim_1])

inv(x)

det(x)

diagonal_sum(x)