class_docstr: Cross entropy loss for classification.
class_docstr_tok: ["Cross","entropy","loss","for","classification","."]
code: def loss(self, y_pred, target):
      loss = F.cross_entropy(
          y_pred.view(-1, y_pred.size(-1)),
          target.view(-1),
          reduction="none",
      ).view(-1, target.size(-1))
      return loss
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import scipy.stats
  import torch
  import torch.nn.functional
  from torch.nn.utils import rnn
  from pytorch_forecasting.metrics.base_metrics import MultiHorizonMetric
  from pytorch_forecasting.utils import create_mask, unpack_sequence, unsqueeze_like
label_desc: Use image node_id 1 for calling the CrossEntropy obj's underlying member method code with example usage: obj.loss(y_pred, target) and returns: loss