Tensor Compute Functions

tensor_abs(t1, out_format[, dtype])

Calculates the element wise absolute value on the input tensor.

tensor_square(t1, out_format[, dtype])

Squares each input in the tensor.

tensor_cube(t1, out_format[, dtype])

Cubes each input in the tensor.

tensor_sqrt(t1, out_format[, dtype])

Takes the square root of each input in the tensor.

tensor_cube_root(t1, out_format[, dtype])

Takes the cube root of each input in the tensor.

tensor_exp(t1, out_format[, dtype])

Takes the exp of each input in the tensor.

tensor_log(t1, out_format[, dtype])

Takes the natural log of each input in the tensor.

tensor_log10(t1, out_format[, dtype])

Takes the log base 10 of each input in the tensor.

tensor_sin(t1, out_format[, dtype])

Takes the sin of each input in the tensor.

tensor_cos(t1, out_format[, dtype])

Takes the cosine of each input in the tensor.

tensor_tan(t1, out_format[, dtype])

Takes the tan of each input in the tensor.

tensor_asin(t1, out_format[, dtype])

Takes the arcsine of each input in the tensor.

tensor_acos(t1, out_format[, dtype])

Takes the arccosine of each input in the tensor.

tensor_atan(t1, out_format[, dtype])

Takes the arctan of each input in the tensor.

tensor_atan2(t1, out_format[, dtype])

Takes the atan2 of each input in the tensor.

tensor_sinh(t1, out_format[, dtype])

Takes the hyperbolic sine of each input in the tensor.

tensor_cosh(t1, out_format[, dtype])

Takes the hyperbolic cosine of each input in the tensor.

tensor_tanh(t1, out_format[, dtype])

Takes the hyperbolic tangent of each input in the tensor.

tensor_asinh(t1, out_format[, dtype])

Takes the inverse hyperbolic sine of each input in the tensor.

tensor_acosh(t1, out_format[, dtype])

Takes the inverse hyperbolic cosine of each input in the tensor.

tensor_atanh(t1, out_format[, dtype])

Takes the inverse hyperbolic tangent of each input in the tensor.

tensor_logical_not(t1, out_format[, dtype])

Calculates the element wise logical not of the input tensor.

tensor_sum(t1[, axis, out_format, dtype])

Sums a tensor along a specified axis or axes of a tensor.

tensor_add(t1, t2, out_format[, dtype])

Computes the element wise addition of two tensors.

tensor_mul(t1, t2, out_format[, dtype])

Computes the element wise multiplication of two tensors.

tensor_div(t1, t2, out_format[, dtype])

Computes the element wise division of two tensors.

tensor_sub(t1, t2, out_format[, dtype])

Computes the element wise subtraction of two tensors.

tensor_pow(t1, t2, out_format[, dtype])

Computes the t1**t2 element-wise.

tensor_gt(t1, t2, out_format[, dtype])

Computes t1 > t2 element-wise.

tensor_lt(t1, t2, out_format[, dtype])

Computes t1 < t2 element-wise.

tensor_ge(t1, t2, out_format[, dtype])

Computes t1 >= t2 element-wise.

tensor_le(t1, t2, out_format[, dtype])

Computes t1 <= t2 element-wise.

tensor_eq(t1, t2, out_format[, dtype])

Computes t1 == t2 element-wise.

tensor_ne(t1, t2, out_format[, dtype])

Computes t1 != t2 element-wise.

tensor_max(t1, t2, out_format[, dtype])

Computes the element wise maximum of two tensors.

tensor_min(t1, t2, out_format[, dtype])

Computes the element wise minimum of two tensors.

tensor_heaviside(t1, t2, out_format[, dtype])

Computes the element wise heaviside step function of two tensors.

as_type(t, type)

Converts a tensor from one type to another.

matmul(t1, t2[, out_format, dtype])

Matrix multiplication of two tensors.

inner(t1, t2[, out_format, dtype])

The inner product of two arrays.

dot(t1, t2[, out_format, dtype])

The dot product of two tensors.

outer(t1, t2[, out_format, dtype])

Computes the outer product of two vectors.

tensordot(t1, t2[, axes, out_format, dtype])

Compute the tensor dot product along the specified axes for tensors of order >= 1.

Tensor Manipulation Functions

tensor.transpose(new_ordering[, new_format, ...])

Transposes a tensor.


Packs a tensor.


Compiles current expression.


Assemble the indices and values in the specified sparse structures.


Compute the given expression and put the values in the tensor storage.


Compile, assemble, and compute as needed.


Converts a tensor of any format to a dense tensor.


Same as to_array().


Alias for to_array() for compatibility with scipy.


Same as to_sp_csr().


Same as to_sp_csc().


Returns a deep copy of a tensor.

tensor.insert(coords, val)

Increments the value at a given set of coordinates.

tensor.remove_explicit_zeros([new_fmt, ...])

Same as remove_explicit_zeros().

remove_explicit_zeros(t[, new_fmt, new_dtype])

Creates a tensor without explicit zeros.