class_docstr: Wrapper around  :class:`pymc.logprob.transforms.IntervalTransform` for use in the
  ``transform`` argument of a random variable.
  
  Parameters
  ----------
  lower : int or float, optional
      Lower bound of the interval transform. Must be a constant finite value.
      By default (``lower=None``), the interval is not bounded below.
  upper : int or float, optional
      Upper bound of the interval transform. Must be a constant finite value.
      By default (``upper=None``), the interval is not bounded above.
  bounds_fn : callable, optional
      Alternative to lower and upper. Must return a tuple of lower and upper bounds
      as a symbolic function of the respective distribution inputs. If one of lower or
      upper is ``None``, the interval is unbounded on that edge.
  
      .. warning:: Expressions returned by `bounds_fn` should depend only on the
          distribution inputs or other constants. Expressions that depend on nonlocal
          variables, such as other distributions defined in the model context will
          likely break sampling.
  
  
  Examples
  --------
  Create an interval transform between -1 and +1
  
  .. code-block:: python
  
      with pm.Model():
          interval = pm.distributions.transforms.Interval(lower=-1, upper=1)
          x = pm.Normal("x", transform=interval)
  
  Create a lower-bounded interval transform at 0, using a callable
  
  .. code-block:: python
  
      def get_bounds(rng, size, dtype, mu, sigma):
          return 0, None
  
      with pm.Model():
          interval = pm.distributions.transforms.Interval(bounds_fn=get_bounds)
          x = pm.Normal("x", transform=interval)
  
  Create a lower-bounded interval transform that depends on a distribution parameter
  
  .. code-block:: python
  
      def get_bounds(rng, size, dtype, mu, sigma):
          return mu - 1, None
  
      interval = pm.distributions.transforms.Interval(bounds_fn=get_bounds)
  
      with pm.Model():
          mu = pm.Normal("mu")
          x = pm.Normal("x", mu=mu, sigma=2, transform=interval)
class_docstr_tok: ["Wrapper","around",":","class",":","`","pymc.logprob.transforms.IntervalTransform","`","for","use","in","the","``","transform","``","argument","of","a","random","variable",".","Parameters","--","--","--","--","--","lower",":","int","or","float",",","optional","Lower","bound","of","the","interval","transform",".","Must","be","a","constant","finite","value",".","By","default","(","``","lower=None","``",")",",","the","interval","is","not","bounded","below",".","upper",":","int","or","float",",","optional","Upper","bound","of","the","interval","transform",".","Must","be","a","constant","finite","value",".","By","default","(","``","upper=None","``",")",",","the","interval","is","not","bounded","above",".","bounds_fn",":","callable",",","optional","Alternative","to","lower","and","upper",".","Must","return","a","tuple","of","lower","and","upper","bounds","as","a","symbolic","function","of","the","respective","distribution","inputs",".","If","one","of","lower","or","upper","is","``","None","``",",","the","interval","is","unbounded","on","that","edge",".","..","warning",":",":","Expressions","returned","by","`","bounds_fn","`","should","depend","only","on","the","distribution","inputs","or","other","constants",".","Expressions","that","depend","on","nonlocal","variables",",","such","as","other","distributions","defined","in","the","model","context","will","likely","break","sampling",".","Examples","--","--","--","--","Create","an","interval","transform","between","-1","and","+1","..","code-block",":",":","python","with","pm.Model","(",")",":","interval","=","pm.distributions.transforms.Interval","(","lower=-1",",","upper=1",")","x","=","pm.Normal","(","``","x","''",",","transform=interval",")","Create","a","lower-bounded","interval","transform","at","0",",","using","a","callable","..","code-block",":",":","python","def","get_bounds","(","rng",",","size",",","dtype",",","mu",",","sigma",")",":","return","0",",","None","with","pm.Model","(",")",":","interval","=","pm.distributions.transforms.Interval","(","bounds_fn=get_bounds",")","x","=","pm.Normal","(","``","x","''",",","transform=interval",")","Create","a","lower-bounded","interval","transform","that","depends","on","a","distribution","parameter","..","code-block",":",":","python","def","get_bounds","(","rng",",","size",",","dtype",",","mu",",","sigma",")",":","return","mu","-","1",",","None","interval","=","pm.distributions.transforms.Interval","(","bounds_fn=get_bounds",")","with","pm.Model","(",")",":","mu","=","pm.Normal","(","``","mu","''",")","x","=","pm.Normal","(","``","x","''",",","mu=mu",",","sigma=2",",","transform=interval",")"]
code: def __init__(self, lower=None, upper=None, *, bounds_fn=None):
      if bounds_fn is None:
          try:
              bounds = tuple(
                  None
                  if bound is None
                  else pt.constant(bound, ndim=0).data
                  for bound in (lower, upper)
              )
          except (ValueError, TypeError):
              raise ValueError(
                  "Interval bounds must be constant values. If you need expressions that "
                  "depend on symbolic variables use `args_fn`"
              )
  
          lower, upper = (
              None if (bound is None or np.isinf(bound)) else bound
              for bound in bounds
          )
  
          if lower is None and upper is None:
              raise ValueError(
                  "Lower and upper interval bounds cannot both be None"
              )
  
          def bounds_fn(*rv_inputs):
              return lower, upper
  
      super().__init__(args_fn=bounds_fn)
  
imports: import warnings
  from functools import singledispatch
  import numpy
  import pytensor.tensor
  from numpy.core.numeric import normalize_axis_tuple
  from pytensor.graph import Op
  from pytensor.tensor import TensorVariable
  import pymc
  from pymc.logprob.transforms import ChainedTransform, CircularTransform, IntervalTransform, LogOddsTransform, LogTransform, SimplexTransform, Transform
label_desc: Use image node_id 1 to create a new Interval object from inherited base classes: IntervalTransform with example: obj = Interval(lower, upper)