Operations#

Each operation returns a Result: the exact answer rounded once, and the bounds that say which outputs a correct implementation can produce. They are available at the top level, such as er.matmul, and under their category, which this page follows.

Linear algebra: er.linalg#

  • matmul (linalg.products.matmul): the matrix product, with NumPy batching.

  • gemm (linalg.products.gemm): beta * C + alpha * (A @ B), as in addmm, addmv, addr, and baddbmm.

  • matrix_exp and matrix_exp_frechet (linalg.matrix_function): the matrix exponential and its derivative.

Arithmetic: er.arithmetic#

Elementary functions: er.elementary#

  • sqrt and rsqrt (elementary.power): the square root and its reciprocal.

  • exp, expm1, log, and log1p (elementary.exp_log): the exponential and the logarithm, and their forms that stay accurate next to zero.

  • tanh (elementary.hyperbolic): the hyperbolic tangent.

  • sigmoid (elementary.logistic): the logistic function.

Reductions: er.reduction#

  • sum (reduction.arithmetic.sum): the sum over some or all dimensions.

  • logsumexp (reduction.arithmetic.logsumexp): the logarithm of the sum of exponentials.

Scans: er.scan#

Statistics: er.statistics#

  • mean (statistics.descriptive.location): the mean over some or all dimensions.

  • var (statistics.descriptive.dispersion): the variance, with the mean.

  • std (statistics.descriptive.dispersion): the standard deviation, with the mean.

Neural networks: er.nn#

Fourier transforms: er.fft#

Arrays: er.array#

  • scatter_add (array.indexing.scatter): values added into the positions an index names.

Foundations: er.foundations#

Every operation but matrix_exp_frechet has a .backward, documented on its page. Named algorithms, specific ways of computing these operations with their own bounds, such as a fixed order of additions or a tensor core's steps, are in Algorithms.