class_docstr: Distribution over IID samples of a given shape.
  
  Given random variable `X`, one may make a new random variable by concatenating
  samples.  For example, if `X1` and `X2` are iid `Normal(0, 1)` samples then
  `[X1, X2]` is a bi-variate normal random vector.
  
  #### Mathematical Details
  
  With `p` the probability density/mass of the function being sampled, and
  `n` the samples taken, the density/mass of this distribution is
  
  ```none
  p(x) = prod{ p(x[i]) : i = 0, ..., (n - 1) }
  ```
  
  #### Examples
  
  ```python
  tfd = tfp.distributions
  
  # Example 1: Five scalar draws.
  
  s = tfd.Sample(
        tfd.Normal(loc=0, scale=1),
        sample_shape=5)
  x = s.sample()
  # ==> x.shape: [5]
  
  lp = s.log_prob(x)
  # ==> lp.shape: []
  #     Equivalently: tf.reduce_sum(s.distribution.log_prob(x), axis=0)
  #
  # `Sample.log_prob` computes the per-{sample, batch} `log_prob`s then sums
  # over the `Sample.sample_shape` dimensions. In the above example `log_prob`
  # dims `0` is summed out, since it is the `sample_shape` dimension.
  
  # Example 2: `[5, 4]`-draws of a bivariate Normal.
  
  mvn = tfd.MultivariateNormalDiag(loc=tf.zeros([3, 2]))
  mvn.batch_shape ==> [3]
  mvn.event_shape ==> [2]
  
  s = tfd.Sample(mvn, sample_shape=[5, 4])
  s.batch_shape ==> [3]
  s.event_shape ==> [5, 4, 2]
  
  x = s.sample([6, 1])
  # ==> x.shape: [6, 1, 3, 5, 4, 2]
  
  lp = s.log_prob(x)
  # ==> lp.shape: [6, 1, 3]
  #
  # `s.log_prob` will reduce over the event dims of `mvn`, i.e., dim `5`, then
  # sums over `s.sample_shape` dims `[3, 4]` corresponding to shape (slice)
  # `[5, 4]`.
  ```
class_docstr_tok: ["Distribution","over","IID","samples","of","a","given","shape",".","Given","random","variable","`","X","`",",","one","may","make","a","new","random","variable","by","concatenating","samples",".","For","example",",","if","`","X1","`","and","`","X2","`","are","iid","`","Normal","(","0",",","1",")","`","samples","then","`","[","X1",",","X2","]","`","is","a","bi-variate","normal","random","vector",".","#","#","#","#","Mathematical","Details","With","`","p","`","the","probability","density\/mass","of","the","function","being","sampled",",","and","`","n","`","the","samples","taken",",","the","density\/mass","of","this","distribution","is","``","`","none","p","(","x",")","=","prod","{","p","(","x","[","i","]",")",":","i","=","0",",","...",",","(","n","-","1",")","}","``","`","#","#","#","#","Examples","``","`","python","tfd","=","tfp.distributions","#","Example","1",":","Five","scalar","draws",".","s","=","tfd.Sample","(","tfd.Normal","(","loc=0",",","scale=1",")",",","sample_shape=5",")","x","=","s.sample","(",")","#","==",">","x.shape",":","[","5","]","lp","=","s.log_prob","(","x",")","#","==",">","lp.shape",":","[","]","#","Equivalently",":","tf.reduce_sum","(","s.distribution.log_prob","(","x",")",",","axis=0",")","#","#","`","Sample.log_prob","`","computes","the","per-","{","sample",",","batch","}","`","log_prob","`","s","then","sums","#","over","the","`","Sample.sample_shape","`","dimensions",".","In","the","above","example","`","log_prob","`","#","dims","`","0","`","is","summed","out",",","since","it","is","the","`","sample_shape","`","dimension",".","#","Example","2",":","`","[","5",",","4","]","`","-draws","of","a","bivariate","Normal",".","mvn","=","tfd.MultivariateNormalDiag","(","loc=tf.zeros","(","[","3",",","2","]",")",")","mvn.batch_shape","==",">","[","3","]","mvn.event_shape","==",">","[","2","]","s","=","tfd.Sample","(","mvn",",","sample_shape=","[","5",",","4","]",")","s.batch_shape","==",">","[","3","]","s.event_shape","==",">","[","5",",","4",",","2","]","x","=","s.sample","(","[","6",",","1","]",")","#","==",">","x.shape",":","[","6",",","1",",","3",",","5",",","4",",","2","]","lp","=","s.log_prob","(","x",")","#","==",">","lp.shape",":","[","6",",","1",",","3","]","#","#","`","s.log_prob","`","will","reduce","over","the","event","dims","of","`","mvn","`",",","i.e.",",","dim","`","5","`",",","then","#","sums","over","`","s.sample_shape","`","dims","`","[","3",",","4","]","`","corresponding","to","shape","(","slice",")","#","`","[","5",",","4","]","`",".","``","`"]
code: def sample_shape(self):
      return self._sample_shape
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 4 for calling the _Sample obj's underlying member method code with example usage: obj.sample_shape() and returns: self