Caesar AI Atlas

Pure Function

Caesar AI Atlas Definition

A pure function is a function whose output depends only on its inputs and that produces no side effects. It does not read or change external state, which makes it easier to test, parallelize, and use safely in frameworks such as JAX.

Other Definitions

Pure Function Source

A function whose outputs are based only on its inputs, and that has no side effects. Specifically, a pure function doesn't use or change any global state, such as the contents of a file or the value of a variable outside the function. Pure functions can be used to create thread-safe code, which is beneficial when sharding model code across multiple accelerator chips. JAX's function transformation methods require that the input functions are pure functions.

Related Terms