either as a function on singleton constraints:
transform_to.register(my_constraint, my_transform)
or as a decorator on parameterized constraints:
@transform_to.register(MyConstraintClass)
   def my_factory(constraint):
       assert isinstance(constraint, MyConstraintClass)
       return MyTransform(constraint.param1, constraint.param2)
You can create your own registry by creating a new
"ConstraintRegistry" object.
class torch.distributions.constraint_registry.ConstraintRegistry
Registry to link constraints to transforms.
register(constraint, factory=None)
  Registers a "Constraint" subclass in this registry. Usage:

     @my_registry.register(MyConstraintClass)
     def construct_transform(constraint):
         assert isinstance(constraint, MyConstraint)
         return MyTransform(constraint.arg_constraints)

  Parameters:
     * **constraint** (subclass of "Constraint") -- A subclass of
       "Constraint", or a singleton object of the desired class.
