class_docstr: Categorical distribution with noise for discrete action spaces
class_docstr_tok: ["Categorical","distribution","with","noise","for","discrete","action","spaces"]
docstr: Returns:
      sample_action: An int64 tensor with shape [BATCH_SIZE, NUM_ACTIOINS] of sample action,
                     with noise to keep the target close to the original action.
docstr_tok: ["Returns",":","sample_action",":","An","int64","tensor","with","shape","[","BATCH_SIZE",",","NUM_ACTIOINS","]","of","sample","action",",","with","noise","to","keep","the","target","close","to","the","original","action","."]
code: def sample(self):
      """
      Returns:
          sample_action: An int64 tensor with shape [BATCH_SIZE, NUM_ACTIOINS] of sample action,
                         with noise to keep the target close to the original action.
      """
      eps = 1e-4
      logits_shape = paddle.to_tensor(self.logits.shape, dtype="int64")
      uniform = paddle.uniform(logits_shape, min=eps, max=1.0 - eps)
      soft_uniform = paddle.log(-1.0 * paddle.log(uniform))
      return F.softmax(self.logits - soft_uniform, axis=-1)
  
imports: import paddle
  import paddle.nn.functional
  import numpy
label_desc: Use image node_id 2 for calling the SoftCategoricalDistribution obj's underlying member method code with example usage: obj.sample() and returns: F