code: def forward(self, logits, labels):
      shift_logits = logits[..., :-1, :].contiguous()
      shift_labels = labels[..., 1:].contiguous()
  
      shift_logits = shift_logits.view(-1, shift_logits.size(-1))
      shift_labels = shift_labels.view(-1)
  
      return self.loss_fn(shift_logits, shift_labels)
  
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 TokenAveragedCrossEntropyLoss obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: self