code: def compute_pred_entropy(logits):
      # logits are pre softmax
      p = F.softmax(logits, dim=-1)
      log_p = F.log_softmax(logits, dim=-1)
      return -(p * log_p).sum(dim=-1).mean()
  
imports: import copy
  import math
  import os
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import Dataset, DataLoader
label_desc: Use image node_id 4 for calling a global function with example usage: compute_pred_entropy(logits) and returns: unknown