Open Deep Learning API
Loading...
Searching...
No Matches
Functions
odla_ops_math.h File Reference

Go to the source code of this file.

Functions

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Abs (odla_value input, const odla_value_id value_id)
 Absolute value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ACos (odla_value x, const odla_value_id value_id)
 ACos. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ACosh (odla_value x, const odla_value_id value_id)
 ACosh. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Add (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Addition. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_And (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Logical and. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ArgMax (odla_value input, odla_int32 axis, odla_bool keep_dims, odla_bool return_last_index, odla_value_type output_value_type, const odla_value_id value_id)
 Find the indices of the largest elements. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ArgMin (odla_value input, odla_int32 axis, odla_bool keep_dims, odla_bool return_last_index, odla_value_type output_value_type, const odla_value_id value_id)
 Find the indices of the smallest elements. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ASin (odla_value x, const odla_value_id value_id)
 ASin. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ASinh (odla_value x, const odla_value_id value_id)
 ASinh. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ATan (odla_value x, const odla_value_id value_id)
 ATan. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ATanh (odla_value x, const odla_value_id value_id)
 ATanh. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Ceil (odla_value input, const odla_value_id value_id)
 Round up a value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Clamp (odla_value input, odla_float32 lo, odla_float32 hi, const odla_value_id value_id)
 Clamp a value to a given range. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Det (odla_value input, odla_value_shape output_shape, const odla_value_id value_id)
 Compute the determinant of a square matrix. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_CumSum (odla_value input, odla_value axis, odla_bool exclusion, odla_bool reverse, const odla_value_id value_id)
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Div (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Division. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Einsum (odla_values inputs, const odla_char *equation, odla_value_shape output_dims, const odla_value_id value_id)
 Compute Einstein summation. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Erf (odla_value input, const odla_value_id value_id)
 Compute guass error of the given input. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Equal (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Equality test. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Exp (odla_value input, const odla_value_id value_id)
 Compute exponential function. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Floor (odla_value input, const odla_value_id value_id)
 Round down a value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_BatchMatMul (odla_value A, odla_bool A_transpose, odla_value B, odla_bool B_transpose, odla_value_shape output_dims, const odla_value_id value_id)
 General Batch Matrix Multiplication. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Gemm (odla_value A, odla_bool A_transpose, odla_value B, odla_bool B_transpose, odla_float32 alpha, odla_float32 beta, odla_value C, odla_value_shape output_dims, const odla_value_id value_id)
 General Matrix Multiplication. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Greater (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 "Greater Than" test More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_GreaterOrEqual (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 "Greater Than Or Equal" test More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Inverse (odla_value input, const odla_value_id value_id)
 Inverse of a square matrix. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_IsInf (odla_value input, odla_bool detect_pos, odla_bool detect_neg, const odla_value_id value_id)
 Check infinity. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_IsNaN (odla_value input, const odla_value_id value_id)
 Check whether element of input is a number. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Less (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 "Less Than" test More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_LessOrEqual (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 "Less Than Or Equal" test More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Log (odla_value input, const odla_value_id value_id)
 Compute the natural logrithm. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Max (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Return the element-wise largest value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mean (odla_values inputs, const odla_value_id value_id)
 Compute the element-wise mean value of inputs. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Min (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Returns the element-wise smallest value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mod (odla_value lhs, odla_value rhs, odla_int64 fmod, const odla_value_id value_id)
 Returns the element-wise modulus value. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mul (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Multiplication. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Neg (odla_value input, const odla_value_id value_id)
 Flip the sign. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Not (odla_value input, const odla_value_id value_id)
 Logical negation. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_NotEqual (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Logical or. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Or (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Logic or test. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Xor (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Logic xor test. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Pow (odla_value base, odla_value exponent, const odla_value_id value_id)
 Raise to power. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Reciprocal (odla_value input, const odla_value_id value_id)
 Compute reciprocal. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceL1 (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_float32 epsilon, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the L1 norm alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceL2 (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_float32 epsilon, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the L2 norm alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceLogSum (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the log sum alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceLogSumExp (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the log sum exponent alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMax (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the max alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMean (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the mean alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMin (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the min alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceProd (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the production alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceSum (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the sum alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceSumSquare (odla_value input, odla_size_t num_of_axes, const odla_uint32 *axes, odla_bool keep_dims, odla_value_shape output_dims, const odla_value_id value_id)
 Compute the sum square alone axes. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Round (odla_value input, const odla_value_id value_id)
 Round to nearest. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Rsqrt (odla_value input, const odla_value_id value_id)
 reciprocal square root More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Select (odla_value condition, odla_value a, odla_value b, odla_value_shape output_dims, const odla_value_id value_id)
 conditional (ternary) operator More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Shift (odla_value input, odla_value shift_amount, odla_bool is_left_shift, const odla_value_id value_id)
 bit shift More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sign (odla_value input, const odla_value_id value_id)
 Sign of input. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sqrt (odla_value input, const odla_value_id value_id)
 Square root. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_SquaredDifference (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Squared Difference. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sub (odla_value lhs, odla_value rhs, const odla_value_id value_id)
 Subtraction. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sin (odla_value x, const odla_value_id value_id)
 Sin. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sinh (odla_value x, const odla_value_id value_id)
 Sinh. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Cos (odla_value x, const odla_value_id value_id)
 Cos. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Cosh (odla_value x, const odla_value_id value_id)
 Cosh. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Tan (odla_value x, const odla_value_id value_id)
 Tan. More...
 
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Tanh (odla_value x, const odla_value_id value_id)
 Tanh. More...
 

Detailed Description

This file defines the ODLA mathematic operators.

Definition in file odla_ops_math.h.

Function Documentation

◆ odla_Abs()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Abs ( odla_value  input,
const odla_value_id  value_id 
)

Absolute value.

Abs returns the absolute value of input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ACos()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ACos ( odla_value  x,
const odla_value_id  value_id 
)

ACos.

Computes acos of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ACosh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ACosh ( odla_value  x,
const odla_value_id  value_id 
)

ACosh.

Computes acosh of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Add()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Add ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Addition.

Add returns the element-wise binary addition of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_And()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_And ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Logical and.

And returns the element-wise binary logical and of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ArgMax()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ArgMax ( odla_value  input,
odla_int32  axis,
odla_bool  keep_dims,
odla_bool  return_last_index,
odla_value_type  output_value_type,
const odla_value_id  value_id 
)

Find the indices of the largest elements.

Argmax returns the indices of the largest elements of input alone the specified axis. If keep_dims is true, then the resulting value has the reduced dimension pruned. Otherwise the resulting value has the same rank as input. If the max occurs more than once, return_last_index specifies if the first index or the last index needs to be returned.

Parameters
inputthe input value
axisthe axis to compute the indices
keep_dimskeep the reduced dimension or not
return_last_indexwhich index to return when there is a tie
output_value_typethe output value type (an integer value type)
value_idthe value id assigned to the result
Returns
odla_value

◆ odla_ArgMin()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ArgMin ( odla_value  input,
odla_int32  axis,
odla_bool  keep_dims,
odla_bool  return_last_index,
odla_value_type  output_value_type,
const odla_value_id  value_id 
)

Find the indices of the smallest elements.

ArgMin returns the indices of the smallest elements of input alone the specified axis. If keep_dims is true, then the resulting value has the reduced dimension pruned. Otherwise the resulting value has the same rank as input. If the min occurs more than once, return_last_index specifies if the first index or the last index needs to be returned.

Parameters
inputthe input value
axisthe axis to compute the indices
keep_dimskeep the reduced dimension or not
return_last_indexwhich index to return when there is a tie
output_value_typethe output value type (an integer value type)
value_idthe value id assigned to the result
Returns
odla_value

◆ odla_ASin()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ASin ( odla_value  x,
const odla_value_id  value_id 
)

ASin.

Computes inverse sine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ASinh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ASinh ( odla_value  x,
const odla_value_id  value_id 
)

ASinh.

Computes inverse hyperbolic sine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ATan()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ATan ( odla_value  x,
const odla_value_id  value_id 
)

ATan.

Computes inverse tangent of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ATanh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ATanh ( odla_value  x,
const odla_value_id  value_id 
)

ATanh.

Computes inverse hyperbolic tangent of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_BatchMatMul()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_BatchMatMul ( odla_value  A,
odla_bool  A_transpose,
odla_value  B,
odla_bool  B_transpose,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

General Batch Matrix Multiplication.

Gemm computes:
A * B

Parameters
Athe matrix A
A_tranposeindicates if A needs to be transposed or not
Bthe matrix B
B_tranposeindicates if B needs to be transposed or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Ceil()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Ceil ( odla_value  input,
const odla_value_id  value_id 
)

Round up a value.

Ceil rounds input upward, returning the smallest integral value that is not less than input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Clamp()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Clamp ( odla_value  input,
odla_float32  lo,
odla_float32  hi,
const odla_value_id  value_id 
)

Clamp a value to a given range.

If input is less than lo , returns lo. Otherwise if hi is less than input , returns hi. Otherwise returns input.

Parameters
inputthe input value to clamp
lothe lower bound to clamp to
hithe upper bound to clamp to
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Cos()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Cos ( odla_value  x,
const odla_value_id  value_id 
)

Cos.

Computes cosine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Cosh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Cosh ( odla_value  x,
const odla_value_id  value_id 
)

Cosh.

Computes hyperbolic cosine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Det()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Det ( odla_value  input,
odla_value_shape  output_shape,
const odla_value_id  value_id 
)

Compute the determinant of a square matrix.

Det returns determinant of a squre matrix or batches of square matrices. The rank of resulting value is 1.

Parameters
inputthe input value
output_shapethe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Div()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Div ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Division.

Div returns the element-wise binary division of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Einsum()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Einsum ( odla_values  inputs,
const odla_char equation,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute Einstein summation.

Einsum returns the Einstein summation convention on the inputs.

Parameters
inputsthe input values
equationthe expression
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Equal()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Equal ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Equality test.

Equal tests if lhs and rhs are equal or not. The returning element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value.

◆ odla_Erf()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Erf ( odla_value  input,
const odla_value_id  value_id 
)

Compute guass error of the given input.

Erf returns element-wise guass error of input. The result value type is the same as input type.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Exp()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Exp ( odla_value  input,
const odla_value_id  value_id 
)

Compute exponential function.

Exp returns the element-wise base-e exponential function of input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Floor()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Floor ( odla_value  input,
const odla_value_id  value_id 
)

Round down a value.

Floor rounds input downward, returning the largest integral value that is not greater than input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Gemm()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Gemm ( odla_value  A,
odla_bool  A_transpose,
odla_value  B,
odla_bool  B_transpose,
odla_float32  alpha,
odla_float32  beta,
odla_value  C,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

General Matrix Multiplication.

Gemm computes:
alpha * A * B + beta * C
alpha * A^T * B + beta * C
alpha * A * B^T + beta * C
alpha * A^T * B^T + beta * C

Parameters
Athe matrix A
A_tranposeindicates if A needs to be transposed or not
Bthe matrix B
B_tranposeindicates if B needs to be transposed or not
alphathe alpha value
betathe beta value
Cthe optional matrix (can be NULL)
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Greater()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Greater ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

"Greater Than" test

Greater tests if lhs is greater than rhs. The result element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_GreaterOrEqual()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_GreaterOrEqual ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

"Greater Than Or Equal" test

Greater tests if lhs is greater than rhs. The result element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Inverse()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Inverse ( odla_value  input,
const odla_value_id  value_id 
)

Inverse of a square matrix.

Inverse returns the inverse of a square matrix or batches of square matrices.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_IsInf()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_IsInf ( odla_value  input,
odla_bool  detect_pos,
odla_bool  detect_neg,
const odla_value_id  value_id 
)

Check infinity.

IsInf returns the bool array input.

Parameters
inputthe input value
detect_poswhether detect positive infinity
detect_negwhether detect negative infinity
value_ida unique value id (can be NULL)
Returns
odla_bool

◆ odla_IsNaN()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_IsNaN ( odla_value  input,
const odla_value_id  value_id 
)

Check whether element of input is a number.

IsNaN returns the bool array input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_bool

◆ odla_Less()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Less ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

"Less Than" test

Less tests if lhs is less than rhs. The result element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_LessOrEqual()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_LessOrEqual ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

"Less Than Or Equal" test

Less tests if lhs is less than rhs. The result element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Log()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Log ( odla_value  input,
const odla_value_id  value_id 
)

Compute the natural logrithm.

Log returns the natural logarithm of input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Max()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Max ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Return the element-wise largest value.

Max returns the largest of lhs and rhs for each element.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Mean()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mean ( odla_values  inputs,
const odla_value_id  value_id 
)

Compute the element-wise mean value of inputs.

Mean returns the element-wise mean of each input values. All inputs must have the same type.

Parameters
inputsthe input values
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Min()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Min ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Returns the element-wise smallest value.

Min returns the smallest of lhs and rhs for each element.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Mod()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mod ( odla_value  lhs,
odla_value  rhs,
odla_int64  fmod,
const odla_value_id  value_id 
)

Returns the element-wise modulus value.

Mod returns the modulus of lhs and rhs for each element.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Mul()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Mul ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Multiplication.

Mul returns the element-wise binary mulitplication of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Neg()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Neg ( odla_value  input,
const odla_value_id  value_id 
)

Flip the sign.

Neg returns the element-wise negation (y = -x).

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Not()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Not ( odla_value  input,
const odla_value_id  value_id 
)

Logical negation.

Not returns the element-wise negation (y = ! x).

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_NotEqual()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_NotEqual ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Logical or.

Or returns the element-wise binary logical or of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

Inequality test

Equal tests if lhs and rhs are equal or not. The returning element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value.

◆ odla_Or()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Or ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Logic or test.

logic tests operator lhs or rhs . The returning element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value.

◆ odla_Pow()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Pow ( odla_value  base,
odla_value  exponent,
const odla_value_id  value_id 
)

Raise to power.

Pow returns element-wise base raised to the power exponent.

Parameters
basethe base value
exponentthe exponent value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Reciprocal()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Reciprocal ( odla_value  input,
const odla_value_id  value_id 
)

Compute reciprocal.

Reciprocal returns the element-wise reciprocal (y = 1 / x).

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceL1()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceL1 ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_float32  epsilon,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the L1 norm alone axes.

ReduceL1 returns the L1 norm of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
epsilonuse to avoid division by zero
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceL2()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceL2 ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_float32  epsilon,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the L2 norm alone axes.

ReduceL2 returns the L2 norm of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
epsilonuse to avoid division by zero
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceLogSum()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceLogSum ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the log sum alone axes.

ReduceLogSum returns the log sum of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceLogSumExp()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceLogSumExp ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the log sum exponent alone axes.

ReduceLogSumExp returns the log sum exponent of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceMax()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMax ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the max alone axes.

ReduceMax returns the max of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceMean()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMean ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the mean alone axes.

ReduceMean returns the mean of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceMin()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceMin ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the min alone axes.

ReduceMin returns the min of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceProd()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceProd ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the production alone axes.

ReduceProd returns the production of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceSum()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceSum ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the sum alone axes.

ReduceSum returns the sum of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_ReduceSumSquare()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_ReduceSumSquare ( odla_value  input,
odla_size_t  num_of_axes,
const odla_uint32 axes,
odla_bool  keep_dims,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

Compute the sum square alone axes.

ReduceSumSquare returns the sum square of input alone axes.

Parameters
inputthe input value
num_of_axesnubmer of axes to reduce
axesthe axes to reduce
keep_dimskeep the reduced dimension or not
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Round()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Round ( odla_value  input,
const odla_value_id  value_id 
)

Round to nearest.

For each element of input , round returns the integral value that is nearest to input , with halfway cases rounded away from zero.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Rsqrt()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Rsqrt ( odla_value  input,
const odla_value_id  value_id 
)

reciprocal square root

Rsqrt returns the element-wise reciprocal square root of input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Select()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Select ( odla_value  condition,
odla_value  a,
odla_value  b,
odla_value_shape  output_dims,
const odla_value_id  value_id 
)

conditional (ternary) operator

Returns elements, either from A or B, based on the boolean elements of Condition.

Parameters
conditionthe condition value
athe values to select from when condition is True
bthe values to select from when condition is False
output_dimsthe optional output shape (can be undefined)
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Shift()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Shift ( odla_value  input,
odla_value  shift_amount,
odla_bool  is_left_shift,
const odla_value_id  value_id 
)

bit shift

Shift returns the element-wise bit shift of input.

Parameters
inputthe input value
shift_amountthe shift amount
is_left_shiftthe shift direction
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Sign()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sign ( odla_value  input,
const odla_value_id  value_id 
)

Sign of input.

Sign returns the element-wise sign of input. The element type of returned value is implementation determined.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_value (odla_int32)

◆ odla_Sin()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sin ( odla_value  x,
const odla_value_id  value_id 
)

Sin.

Computes sine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Sinh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sinh ( odla_value  x,
const odla_value_id  value_id 
)

Sinh.

Computes hyperbolic sine of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Sqrt()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sqrt ( odla_value  input,
const odla_value_id  value_id 
)

Square root.

Sqrt returns the element-wise square root of input.

Parameters
inputthe input value
value_ida unique value id (can be NULL)
Returns
odla_val

◆ odla_SquaredDifference()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_SquaredDifference ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Squared Difference.

SquaredDifference returns ( lhs - rhs )( lhs - rhs ) element-wise. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Sub()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Sub ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Subtraction.

Sub returns the element-wise binary subtraction of lhs and rhs. It supports broadcasting to the same dimension as lhs.

Parameters
lhsthe first value
rhsthe second value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Tan()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Tan ( odla_value  x,
const odla_value_id  value_id 
)

Tan.

Computes tangent of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Tanh()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Tanh ( odla_value  x,
const odla_value_id  value_id 
)

Tanh.

Computes hyperbolic tangent of x element-wise.

Parameters
xinput value
idthe value id assigned to the result
value_ida unique value id (can be NULL)
Returns
odla_value

◆ odla_Xor()

ODLA_API_EXPORT odla_value ODLA_API_CALL odla_Xor ( odla_value  lhs,
odla_value  rhs,
const odla_value_id  value_id 
)

Logic xor test.

logic tests operator lhs xor rhs . The returning element type is implementation determined.

Parameters
lhsthe first value
rhsthe second value
value_ida unique value id (can be NULL)
Returns
odla_value.