def __init__(<EOL>self,<EOL>temperature,<EOL>logits=None,<EOL>probs=None,<EOL>validate_args=False,<EOL>allow_nan_stats=True,<EOL>name="<STR_LIT>"):
parameters = dict(locals())<EOL>with tf.name_scope(name) as name:<EOL><INDENT>dtype = dtype_util.common_dtype([logits, probs, temperature], tf.float32)<EOL>self._logits, self._probs = distribution_util.get_logits_and_probs(<EOL>name=name,<EOL>logits=logits,<EOL>probs=probs,<EOL>validate_args=validate_args,<EOL>multidimensional=True,<EOL>dtype=dtype)<EOL>with tf.control_dependencies(<EOL>[assert_util.assert_positive(temperature)] if validate_args else []):<EOL><INDENT>self._temperature = tf.convert_to_tensor(<EOL>value=temperature, name="<STR_LIT>", dtype=dtype)<EOL>self._temperature_2d = tf.reshape(<EOL>self._temperature, [-<NUM_LIT:1>, <NUM_LIT:1>], name="<STR_LIT>")<EOL><DEDENT>logits_shape_static = tensorshape_util.with_rank_at_least(<EOL>self._logits.shape, <NUM_LIT:1>)<EOL>if tensorshape_util.rank(logits_shape_static) is not None:<EOL><INDENT>self._batch_rank = tf.convert_to_tensor(<EOL>value=tensorshape_util.rank(logits_shape_static) - <NUM_LIT:1>,<EOL>dtype=tf.int32,<EOL>name="<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>with tf.name_scope("<STR_LIT>"):<EOL><INDENT>self._batch_rank = tf.rank(self._logits) - <NUM_LIT:1><EOL><DEDENT><DEDENT>with tf.name_scope("<STR_LIT>"):<EOL><INDENT>self._event_size = tf.shape(input=self._logits)[-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>super(ExpRelaxedOneHotCategorical, self).__init__(<EOL>dtype=dtype,<EOL>reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,<EOL>validate_args=validate_args,<EOL>allow_nan_stats=allow_nan_stats,<EOL>parameters=parameters,<EOL>graph_parents=[self._logits, self._probs, self._temperature],<EOL>name=name)<EOL>
Initialize ExpRelaxedOneHotCategorical using class log-probabilities.

        Args:
          temperature: An 0-D `Tensor`, representing the temperature
            of a set of ExpRelaxedCategorical distributions. The temperature should
            be positive.
          logits: An N-D `Tensor`, `N >= 1`, representing the log probabilities
            of a set of ExpRelaxedCategorical distributions. The first
            `N - 1` dimensions index into a batch of independent distributions and
            the last dimension represents a vector of logits for each class. Only
            one of `logits` or `probs` should be passed in.
          probs: An N-D `Tensor`, `N >= 1`, representing the probabilities
            of a set of ExpRelaxedCategorical distributions. The first
            `N - 1` dimensions index into a batch of independent distributions and
            the last dimension represents a vector of probabilities for each
            class. Only one of `logits` or `probs` should be passed in.
          validate_args: Python `bool`, default `False`. When `True` distribution
            parameters are checked for validity despite possibly degrading runtime
            performance. When `False` invalid inputs may silently render incorrect
            outputs.
          allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
            (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
            result is undefined. When `False`, an exception is raised if one or
            more of the statistic's batch members are undefined.
          name: Python `str` name prefixed to Ops created by this class.