code: def _verify_logit_target_shape(logits: Tensor, target: Tensor):
      if logits.ndim != 4:
          raise ValueError("Only expect 4-dimensional logits.")
  
      expected_target_numel = (
          logits.shape[0] * logits.shape[-2] * logits.shape[-1]
      )
      actual_target_shape = target.numel()
      logits_shape = logits.shape
      if expected_target_numel != actual_target_shape:
          raise ValueError(
              f"Based on logits size {logits_shape}, expected target numel to be "
              f"{expected_target_numel}, but found {actual_target_shape}"
          )
  
file_path: NeuralCompression/neuralcompression/loss_fn/_oasis_loss.py
imports: import torch
  import torch.nn.functional
  from torch import Tensor
  from ._gan_losses import DiscriminatorLoss, GeneratorLoss
label_desc: Use image node_id 1 for calling a global function with example usage: _verify_logit_target_shape(logits, target) without return types