code: def _perplexity_compute(total: Tensor, count: Tensor) -> Tensor:
      """Compute the Perplexity.
  
      Args:
          total: Log probabilities, summed over all samples
          count: Number of samples
      Returns:
          Perplexity
  
      """
      return torch.exp(total / count)
  
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _perplexity_compute(total, count) and returns: torch