class_docstr: An `Op` that produces a sample from a random variable.
  
  This is essentially `RandomFunction`, except that it removes the
  `outtype` dependency and handles shape dimension information more
  directly.
class_docstr_tok: ["An","`","Op","`","that","produces","a","sample","from","a","random","variable",".","This","is","essentially","`","RandomFunction","`",",","except","that","it","removes","the","`","outtype","`","dependency","and","handles","shape","dimension","information","more","directly","."]
docstr: Create a random variable `Op`.
  
  Parameters
  ----------
  name: str
      The `Op`'s display name.
  ndim_supp: int
      Total number of dimensions for a single draw of the random variable
      (e.g. a multivariate normal draw is 1D, so ``ndim_supp = 1``).
  ndims_params: list of int
      Number of dimensions for each distribution parameter when the
      parameters only specify a single drawn of the random variable
      (e.g. a multivariate normal's mean is 1D and covariance is 2D, so
      ``ndims_params = [1, 2]``).
  dtype: str (optional)
      The dtype of the sampled output.  If the value ``"floatX"`` is
      given, then ``dtype`` is set to ``pytensor.config.floatX``.  If
      ``None`` (the default), the `dtype` keyword must be set when
      `RandomVariable.make_node` is called.
  inplace: boolean (optional)
      Determine whether or not the underlying rng state is updated
      in-place or not (i.e. copied).
docstr_tok: ["Create","a","random","variable","`","Op","`",".","Parameters","--","--","--","--","--","name",":","str","The","`","Op","`","'s","display","name",".","ndim_supp",":","int","Total","number","of","dimensions","for","a","single","draw","of","the","random","variable","(","e.g",".","a","multivariate","normal","draw","is","1D",",","so","``","ndim_supp","=","1","``",")",".","ndims_params",":","list","of","int","Number","of","dimensions","for","each","distribution","parameter","when","the","parameters","only","specify","a","single","drawn","of","the","random","variable","(","e.g",".","a","multivariate","normal","'s","mean","is","1D","and","covariance","is","2D",",","so","``","ndims_params","=","[","1",",","2","]","``",")",".","dtype",":","str","(","optional",")","The","dtype","of","the","sampled","output",".","If","the","value","``","``","floatX","''","``","is","given",",","then","``","dtype","``","is","set","to","``","pytensor.config.floatX","``",".","If","``","None","``","(","the","default",")",",","the","`","dtype","`","keyword","must","be","set","when","`","RandomVariable.make_node","`","is","called",".","inplace",":","boolean","(","optional",")","Determine","whether","or","not","the","underlying","rng","state","is","updated","in-place","or","not","(","i.e",".","copied",")","."]
code: def __init__(
      self,
      name=None,
      ndim_supp=None,
      ndims_params=None,
      dtype=None,
      inplace=None,
  ):
      """Create a random variable `Op`.
  
      Parameters
      ----------
      name: str
          The `Op`'s display name.
      ndim_supp: int
          Total number of dimensions for a single draw of the random variable
          (e.g. a multivariate normal draw is 1D, so ``ndim_supp = 1``).
      ndims_params: list of int
          Number of dimensions for each distribution parameter when the
          parameters only specify a single drawn of the random variable
          (e.g. a multivariate normal's mean is 1D and covariance is 2D, so
          ``ndims_params = [1, 2]``).
      dtype: str (optional)
          The dtype of the sampled output.  If the value ``"floatX"`` is
          given, then ``dtype`` is set to ``pytensor.config.floatX``.  If
          ``None`` (the default), the `dtype` keyword must be set when
          `RandomVariable.make_node` is called.
      inplace: boolean (optional)
          Determine whether or not the underlying rng state is updated
          in-place or not (i.e. copied).
  
      """
      super().__init__()
  
      self.name = name or getattr(self, "name")
      self.ndim_supp = (
          ndim_supp
          if ndim_supp is not None
          else getattr(self, "ndim_supp")
      )
      self.ndims_params = (
          ndims_params
          if ndims_params is not None
          else getattr(self, "ndims_params")
      )
      self.dtype = dtype or getattr(self, "dtype", None)
  
      self.inplace = (
          inplace
          if inplace is not None
          else getattr(self, "inplace", False)
      )
  
      if not isinstance(self.ndims_params, Sequence):
          raise TypeError(
              "Parameter ndims_params must be sequence type."
          )
  
      self.ndims_params = tuple(self.ndims_params)
  
      if self.inplace:
          self.destroy_map = {0: [0]}
  
imports: from collections.abc import Sequence
  from copy import copy
  from typing import Optional, Union
  import numpy
  import pytensor
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Variable, equal_computations
  from pytensor.graph.op import Op
  from pytensor.graph.replace import _vectorize_node
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.scalar import ScalarVariable
  from pytensor.tensor.basic import as_tensor_variable, concatenate, constant, get_underlying_scalar_constant_value, get_vector_length, infer_static_shape
  from pytensor.tensor.random.type import RandomGeneratorType, RandomStateType, RandomType
  from pytensor.tensor.random.utils import broadcast_params, normalize_size_param
  from pytensor.tensor.shape import shape_tuple
  from pytensor.tensor.type import TensorType, all_dtypes
  from pytensor.tensor.type_other import NoneConst
  from pytensor.tensor.variable import TensorVariable
label_desc: Use image node_id 1 to create a new RandomVariable object from inherited base classes: Op with example: obj = RandomVariable(name, ndim_supp, ndims_params, dtype, inplace)