|
Open Deep Learning API
|
Go to the source code of this file.
This file defines the ODLA mathematic operators.
Definition in file odla_ops_math.h.
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| axis | the axis to compute the indices |
| keep_dims | keep the reduced dimension or not |
| return_last_index | which index to return when there is a tie |
| output_value_type | the output value type (an integer value type) |
| value_id | the value id assigned to the result |
| 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.
| input | the input value |
| axis | the axis to compute the indices |
| keep_dims | keep the reduced dimension or not |
| return_last_index | which index to return when there is a tie |
| output_value_type | the output value type (an integer value type) |
| value_id | the value id assigned to the result |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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
| A | the matrix A |
| A_tranpose | indicates if A needs to be transposed or not |
| B | the matrix B |
| B_tranpose | indicates if B needs to be transposed or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value to clamp |
| lo | the lower bound to clamp to |
| hi | the upper bound to clamp to |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| output_shape | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| inputs | the input values |
| equation | the expression |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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
| A | the matrix A |
| A_tranpose | indicates if A needs to be transposed or not |
| B | the matrix B |
| B_tranpose | indicates if B needs to be transposed or not |
| alpha | the alpha value |
| beta | the beta value |
| C | the optional matrix (can be NULL) |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| detect_pos | whether detect positive infinity |
| detect_neg | whether detect negative infinity |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| inputs | the input values |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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).
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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).
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
Inequality test
Equal tests if lhs and rhs are equal or not. The returning element type is implementation determined.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| base | the base value |
| exponent | the exponent value |
| value_id | a unique value id (can be NULL) |
| 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).
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| epsilon | use to avoid division by zero |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| epsilon | use to avoid division by zero |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| num_of_axes | nubmer of axes to reduce |
| axes | the axes to reduce |
| keep_dims | keep the reduced dimension or not |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| condition | the condition value |
| a | the values to select from when condition is True |
| b | the values to select from when condition is False |
| output_dims | the optional output shape (can be undefined) |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| shift_amount | the shift amount |
| is_left_shift | the shift direction |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| input | the input value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| x | input value |
| id | the value id assigned to the result |
| value_id | a unique value id (can be NULL) |
| 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.
| lhs | the first value |
| rhs | the second value |
| value_id | a unique value id (can be NULL) |