class_docstr: Samples from a distribution and transforms samples into specified size.
  
  The connector is the same as
  :class:`~texar.tf.modules.ReparameterizedStochasticConnector`, except that
  here reparameterization is disabled, and thus the gradients cannot be
  back-propagated through the stochastic samples.
  
  Args:
      output_size: Size of output **excluding** the batch dimension. For
          example, set `output_size` to `dim` to generate output of
          shape `[batch_size, dim]`.
          Can be an `int`, a tuple of `int`, a Tensorshape, or a tuple of
          TensorShapes.
          For example, to transform inputs to have decoder state size, set
          `output_size=decoder.state_size`.
      hparams (dict, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
  
  .. document private functions
  .. automethod:: _build
class_docstr_tok: ["Samples","from","a","distribution","and","transforms","samples","into","specified","size",".","The","connector","is","the","same","as",":","class",":","`","~texar.tf.modules.ReparameterizedStochasticConnector","`",",","except","that","here","reparameterization","is","disabled",",","and","thus","the","gradients","can","not","be","back-propagated","through","the","stochastic","samples",".","Args",":","output_size",":","Size","of","output","*","*","excluding","*","*","the","batch","dimension",".","For","example",",","set","`","output_size","`","to","`","dim","`","to","generate","output","of","shape","`","[","batch_size",",","dim","]","`",".","Can","be","an","`","int","`",",","a","tuple","of","`","int","`",",","a","Tensorshape",",","or","a","tuple","of","TensorShapes",".","For","example",",","to","transform","inputs","to","have","decoder","state","size",",","set","`","output_size=decoder.state_size","`",".","hparams","(","dict",",","optional",")",":","Hyperparameters",".","Missing","hyperparamerter","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","sturcture","and","default","values",".","..","document","private","functions","..","automethod",":",":","_build"]
code: def __init__(self, output_size, hparams=None):
      ConnectorBase.__init__(self, output_size, hparams)
  
imports: import numpy
  import tensorflow
  from tensorflow import distributions
  from tensorflow.python.util import nest
  from texar.tf.modules.connectors.connector_base import ConnectorBase
  from texar.tf.core import layers
  from texar.tf.utils.utils import get_function, check_or_get_instance
label_desc: Use image node_id 1 to create a new StochasticConnector object from inherited base classes: ConnectorBase with example: obj = StochasticConnector(output_size, hparams)