class_docstr: Categorical distribution for discrete action spaces.
class_docstr_tok: ["Categorical","distribution","for","discrete","action","spaces","."]
docstr: Returns:
      entropy: A float32 tensor with shape [BATCH_SIZE] of entropy of self policy distribution.
docstr_tok: ["Returns",":","entropy",":","A","float32","tensor","with","shape","[","BATCH_SIZE","]","of","entropy","of","self","policy","distribution","."]
code: def entropy(self):
      """
      Returns:
          entropy: A float32 tensor with shape [BATCH_SIZE] of entropy of self policy distribution.
      """
      print(self.logits.shape)
      print(self.logits.shape)
      logits = (
          self.logits - torch.max(self.logits, dim=1, keepdim=True)[0]
      )
      e_logits = torch.exp(logits)
      z = torch.sum(e_logits, dim=1, keepdim=True)
      prob = e_logits / z
      entropy = -1.0 * torch.sum(prob * (logits - torch.log(z)), dim=1)
  
      return entropy
  
imports: import torch
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 3 for calling the CategoricalDistribution obj's underlying member method code with example usage: obj.entropy() and returns: entropy