Skip to content

Add an Evaluator

Evaluators are callables:

class MyEvaluator:
    def __call__(self, x, conditions=None):
        return {
            "stress": stress,
            "mass": mass,
        }

Guidelines:

  • Return a dictionary of tensors.
  • Keep tensor shapes batched.
  • Keep computations differentiable when possible.
  • Handle missing optional dependencies with clear errors.
  • Avoid writing files unless the workflow explicitly asks for it.

Register the evaluator:

registry.add("evaluator", "my_solver", MyEvaluator)