jacinle.utils.numeric#

Functions

divup(n, d)

Divide n by d and round up.

mean(values[, default])

A mean function that returns the default value when the input is empty.

prod(values[, default])

A product function that returns the default value when the input is empty.

rms(values[, default])

A root mean square function that returns the default value when the input is empty.

safe_sum(*values)

A safe sum function that uses the first value as the initial value.

std(values[, default])

A standard deviation function that returns the default value when the input is empty.

Functions

divup(n, d)[source]#

Divide n by d and round up.

mean(values, default=0)[source]#

A mean function that returns the default value when the input is empty.

prod(values, default=1)[source]#

A product function that returns the default value when the input is empty.

rms(values, default=0)[source]#

A root mean square function that returns the default value when the input is empty.

safe_sum(*values)[source]#

A safe sum function that uses the first value as the initial value. It can be used as a replacement of sum().

std(values, default=0)[source]#

A standard deviation function that returns the default value when the input is empty.