class_docstr: Base class for random variables.
  
  A random variable is an object parameterized by tensors. It is
  equipped with methods such as the log-density, mean, and sample.
  
  It also wraps a tensor, where the tensor corresponds to a sample
  from the random variable. This enables operations on the TensorFlow
  graph, allowing random variables to be used in conjunction with
  other TensorFlow ops.
  
  The random variable's shape is given by
  
  `sample_shape + batch_shape + event_shape`,
  
  where `sample_shape` is an optional argument representing the
  dimensions of samples drawn from the distribution (default is
  a scalar); `batch_shape` is the number of independent random variables
  (determined by the shape of its parameters); and `event_shape` is
  the shape of one draw from the distribution (e.g., `Normal` has a
  scalar `event_shape`; `Dirichlet` has a vector `event_shape`).
  
  #### Notes
  
  `RandomVariable` assumes use in a multiple inheritance setting. The
  child class must first inherit `RandomVariable`, then second inherit a
  class in `tf.contrib.distributions`. With Python's method resolution
  order, this implies the following during initialization (using
  `distributions.Bernoulli` as an example):
  
  1. Start the `__init__()` of the child class, which passes all
     `*args, **kwargs` to `RandomVariable`.
  2. This in turn passes all `*args, **kwargs` to
     `distributions.Bernoulli`, completing the `__init__()` of
     `distributions.Bernoulli`.
  3. Complete the `__init__()` of `RandomVariable`, which calls
     `self.sample()`, relying on the method from
     `distributions.Bernoulli`.
  4. Complete the `__init__()` of the child class.
  
  Methods from both `RandomVariable` and `distributions.Bernoulli`
  populate the namespace of the child class. Methods from
  `RandomVariable` will take higher priority if there are conflicts.
  
  #### Examples
  
  ```python
  p = tf.constant(0.5)
  x = Bernoulli(p)
  
  z1 = tf.constant([[1.0, -0.8], [0.3, -1.0]])
  z2 = tf.constant([[0.9, 0.2], [2.0, -0.1]])
  x = Bernoulli(logits=tf.matmul(z1, z2))
  
  mu = Normal(tf.constant(0.0), tf.constant(1.0))
  x = Normal(mu, tf.constant(1.0))
  ```
class_docstr_tok: ["Base","class","for","random","variables",".","A","random","variable","is","an","object","parameterized","by","tensors",".","It","is","equipped","with","methods","such","as","the","log-density",",","mean",",","and","sample",".","It","also","wraps","a","tensor",",","where","the","tensor","corresponds","to","a","sample","from","the","random","variable",".","This","enables","operations","on","the","TensorFlow","graph",",","allowing","random","variables","to","be","used","in","conjunction","with","other","TensorFlow","ops",".","The","random","variable","'s","shape","is","given","by","`","sample_shape","+","batch_shape","+","event_shape","`",",","where","`","sample_shape","`","is","an","optional","argument","representing","the","dimensions","of","samples","drawn","from","the","distribution","(","default","is","a","scalar",")",";","`","batch_shape","`","is","the","number","of","independent","random","variables","(","determined","by","the","shape","of","its","parameters",")",";","and","`","event_shape","`","is","the","shape","of","one","draw","from","the","distribution","(","e.g.",",","`","Normal","`","has","a","scalar","`","event_shape","`",";","`","Dirichlet","`","has","a","vector","`","event_shape","`",")",".","#","#","#","#","Notes","`","RandomVariable","`","assumes","use","in","a","multiple","inheritance","setting",".","The","child","class","must","first","inherit","`","RandomVariable","`",",","then","second","inherit","a","class","in","`","tf.contrib.distributions","`",".","With","Python","'s","method","resolution","order",",","this","implies","the","following","during","initialization","(","using","`","distributions.Bernoulli","`","as","an","example",")",":","1",".","Start","the","`","__init__","(",")","`","of","the","child","class",",","which","passes","all","`","*","args",",","*","*","kwargs","`","to","`","RandomVariable","`",".","2",".","This","in","turn","passes","all","`","*","args",",","*","*","kwargs","`","to","`","distributions.Bernoulli","`",",","completing","the","`","__init__","(",")","`","of","`","distributions.Bernoulli","`",".","3",".","Complete","the","`","__init__","(",")","`","of","`","RandomVariable","`",",","which","calls","`","self.sample","(",")","`",",","relying","on","the","method","from","`","distributions.Bernoulli","`",".","4",".","Complete","the","`","__init__","(",")","`","of","the","child","class",".","Methods","from","both","`","RandomVariable","`","and","`","distributions.Bernoulli","`","populate","the","namespace","of","the","child","class",".","Methods","from","`","RandomVariable","`","will","take","higher","priority","if","there","are","conflicts",".","#","#","#","#","Examples","``","`","python","p","=","tf.constant","(","0.5",")","x","=","Bernoulli","(","p",")","z1","=","tf.constant","(","[","[","1.0",",","-0.8","]",",","[","0.3",",","-1.0","]","]",")","z2","=","tf.constant","(","[","[","0.9",",","0.2","]",",","[","2.0",",","-0.1","]","]",")","x","=","Bernoulli","(","logits=tf.matmul","(","z1",",","z2",")",")","mu","=","Normal","(","tf.constant","(","0.0",")",",","tf.constant","(","1.0",")",")","x","=","Normal","(","mu",",","tf.constant","(","1.0",")",")","``","`"]
code: def __eq__(self, other):
      return id(self) == id(other)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from collections import defaultdict
label_desc: Use image node_id 7 for calling the RandomVariable obj's underlying member method code with example usage: obj.__eq__(other) and returns: unknown