code: def forward(self, logits, labels):
      shift_logits = logits[..., :-1, :].contiguous()
      shift_labels = labels[..., 1:].contiguous()
  
      loss = 0
      for i in range(labels.shape[0]):
          loss += self.loss_fn(shift_logits[i], shift_labels[i])
      loss /= labels.shape[0]
      return loss
  
file_path: h2o-llmstudio/llm_studio/src/losses/text_causal_language_modeling_losses.py
imports: import logging
  from typing import Any, KeysView
  from torch import nn
label_desc: Use image node_id 2 for calling the SampleAveragedCrossEntropyLoss obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: loss