parameters: (self, time, outputs, state, name=None)
return_statement: return sample_ids
docstring: sample for SampleEmbeddingHelper.
docstring_summary: sample for SampleEmbeddingHelper.
docstring_tokens: sample for SampleEmbeddingHelper .
function: def sample(self, time, outputs, state, name=None):
      """sample for SampleEmbeddingHelper."""
      del time, state  # unused by sample_fn
      # Outputs are logits, we sample instead of argmax (greedy).
      if not isinstance(outputs, ops.Tensor):
        raise TypeError("Expected outputs to be a single Tensor, got: %s" %
                        type(outputs))
      if self._softmax_temperature is None:
        logits = outputs
      else:
        logits = outputs / self._softmax_temperature
  
      sample_ids = categorical_sample(logits=logits, seed=self._seed)
  
      return sample_ids
function_tokens: def sample ( self , time , outputs , state , name = None ) : del time , state # unused by sample_fn # Outputs are logits, we sample instead of argmax (greedy). if not isinstance ( outputs , ops . Tensor ) : raise TypeError ( "Expected outputs to be a single Tensor, got: %s" % type ( outputs ) ) if self . _softmax_temperature is None : logits = outputs else : logits = outputs / self . _softmax_temperature sample_ids = categorical_sample ( logits = logits , seed = self . _seed ) return sample_ids