Aggregation function for arrays which does not allocate a new array.
Aggregation function for arrays which does not allocate a new array.
Array to aggregate.
Array to aggregate.
Overwrites a1 with the aggregated value, and returns a1.
Recursively computes the factorial of an integer.
Recursively computes the factorial of an integer.
Value to compute factorial of.
Returns the factorial.
Compute equality of two floating point numbers, given a tolerance.
Compute equality of two floating point numbers, given a tolerance.
Floating point number to compare.
Floating point number to compare.
Tolerance to apply for checking equality.
Returns true if the two numbers are within tol
of each other.
Default value is 1e-6.
Log function which never returns -infinity or NaN
Log function which never returns -infinity or NaN
Value to take log of.
Floor for return value to take on. Default is -1e5.
Returns either the log of the input value, or the floor, whichever is higher.
Multiplies an array by a scalar.
Multiplies an array by a scalar.
Scalar to multiply against array.
Array to multiply. Multiplies array in place.
Computes the additive softmax of an array in place.
Computes the additive softmax of an array in place.
Array to normalize. Normalizes array in place.