torch.distributions.constraints.Constraint
class Constraint- readonly
is_discrete(boolean) - – Whether the constrained space is discrete. Defaults to false for continuous constraints.
- readonly
event_dim(number) - – Number of rightmost dimensions that together define an event. The check() method will consider this when computing validity.
Abstract base class for constraints.
A constraint object represents a region over which a variable is valid, e.g. within which a variable can be optimized.