docstr: Defines an interval constraint for GP model parameters, specified by a lower bound and upper bound. For usage
  details, see the documentation for :meth:`~gpytorch.module.Module.register_constraint`.
  
  Args:
      lower_bound (float or torch.Tensor): The lower bound on the parameter.
      upper_bound (float or torch.Tensor): The upper bound on the parameter.
code: def __init__(
      self,
      lower_bound,
      upper_bound,
      transform=sigmoid,
      inv_transform=inv_sigmoid,
      initial_value=None,
  ):
      """
      Defines an interval constraint for GP model parameters, specified by a lower bound and upper bound. For usage
      details, see the documentation for :meth:`~gpytorch.module.Module.register_constraint`.
  
      Args:
          lower_bound (float or torch.Tensor): The lower bound on the parameter.
          upper_bound (float or torch.Tensor): The upper bound on the parameter.
      """
      dtype = torch.get_default_dtype()
      lower_bound = torch.as_tensor(lower_bound).to(dtype)
      upper_bound = torch.as_tensor(upper_bound).to(dtype)
  
      if torch.any(torch.ge(lower_bound, upper_bound)):
          raise ValueError("Got parameter bounds with empty intervals.")
  
      if type(self) == Interval:
          max_bound = torch.max(upper_bound)
          min_bound = torch.min(lower_bound)
          if max_bound == math.inf or min_bound == -math.inf:
              raise ValueError(
                  "Cannot make an Interval directly with non-finite bounds. Use a derived class like "
                  "GreaterThan or LessThan instead."
              )
  
      super().__init__()
  
      self.register_buffer("lower_bound", lower_bound)
      self.register_buffer("upper_bound", upper_bound)
  
      self._transform = transform
      self._inv_transform = inv_transform
  
      if transform is not None and inv_transform is None:
          self._inv_transform = _get_inv_param_transform(transform)
  
      if initial_value is not None:
          self._initial_value = self.inverse_transform(
              torch.as_tensor(initial_value)
          )
      else:
          self._initial_value = None
  
imports: from __future__ import annotations
  import math
  from typing import Optional
  import torch
  from torch import sigmoid, Tensor
  from torch.nn import Module
  from ..utils.transforms import _get_inv_param_transform, inv_sigmoid, inv_softplus
label_desc: Use image node_id 1 to create a new Interval object from inherited base classes: Module with example: obj = Interval(lower_bound, upper_bound, transform, inv_transform, initial_value)