Skip to main content

Module batching

Module batching 

Source
Expand description

The interface for batching primitives (vmap).

vmap turns a function of single examples into a function of batches by applying each primitive’s batching rule (Primitive::batch). A rule receives its operands with their batch dimensions (Batched) and emits batched operations through BatchCx. The driver, which walks the equations of a function, lives in ruxla-transforms.

Structs§

Batched
A value of the batched function and the position of its batch dimension, or None if it is the same for every example of the batch.

Traits§

BatchCx
A context that emits the operations of a batched function.

Functions§

inline
Emits the equations of f applied to args into cx, and returns the outputs.

Type Aliases§

BuildBody
The body given to BatchCx::build_function: emits operations through the context it receives, from the inputs of the new function, and returns its outputs.