Tensor graphs for evolving programs.
EvoX Compiler turns numerical Python into graphs you can inspect and transform. Batch a population of candidate programs, then run the resulting graph on your chosen backend.
![Three programs share the input [1, 2, 3, 4]. The merged EvoXIR graph returns a separate row for x + 1, x × 2, and x − 3.](/_astro/program-population-dark.C-XLs4RD.webp)
evoxc.batch_functionsGraph transforms Build once.
Score a population.
Each row holds one candidate. This sum-of-squares function returns one fitness value per row. Build it from an input specification and reuse the executable as the population changes.
Install python -m pip install evoxc
Population fitnessPython
import evoxc
@evoxc.defn
def score(candidates):
return evoxc.sum(candidates * candidates, axes=1)
spec = evoxc.TensorSpec((3, 2), evoxc.float32)
exe = evoxc.build(score, spec)
fitness = evoxc.run(exe, evoxc.zeros((3, 2)))Execution backends
Keep the EvoXIR graph and choose how to execute it. Operation coverage and device support depend on the backend.
Explore the backends- NumPy
- Run on the default CPU interpreter with the core Python installation.
- Native
- Use the Rust CPU engine included in published wheels.
- IREE · XLA · TVM
- Lower to StableHLO and use a compiler adapter to build and load an executable.