base#

Base class for obsidian constraints

Classes

Constraint()

Base class for constraints, which restrict the input or output space of a model or optimization problem

class obsidian.constraints.base.Constraint[source]#

Bases: ABC, Module

Base class for constraints, which restrict the input or output space of a model or optimization problem

abstract forward()[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.