code: def label_logprobs(*, logits, labels):
      """cross-entropy for arbitrary shapes"""
      assert (
          logits.shape[:-1] == labels.shape
      ), f"{logits.shape}[:-1] != {labels.shape}"
      flat_logits = logits.contiguous().view([-1, logits.size(-1)])
      flat_labels = labels.contiguous().view([-1])
      flat_logprobs = -F.cross_entropy(
          input=flat_logits, target=flat_labels, reduction="none"
      )
      return flat_logprobs.view(labels.shape)
  
file_path: summarize-from-feedback/summarize_from_feedback/utils/torch_utils.py
imports: import numpy
  import torch
  import torch.nn.functional
label_desc: Use image node_id 6 for calling a global function with example usage: label_logprobs() and returns: flat_logprobs