pure function
A function whose outputs are based only on its inputs, and that has no side effects.
Plain English Explanation
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.
How is it used?
Practitioners refer to pure function when building, training, or evaluating machine learning systems. It appears in research papers, product documentation, and technical discussions about AI capabilities and limitations.