Source code for obsidian.constraints.base

"""Base class for obsidian constraints"""


from abc import abstractmethod, ABC
from torch.nn import Module


[docs] class Constraint(ABC, Module): """ Base class for constraints, which restrict the input or output space of a model or optimization problem """ def __init__(self) -> None: super().__init__() return
[docs] @abstractmethod def forward(self): pass # pragma: no cover