docstr: Called at the end of validation to aggregate outputs.
  :param outputs: list of individual outputs of each validation step.
docstr_tok: ["Called","at","the","end","of","validation","to","aggregate","outputs",".",":","param","outputs",":","list","of","individual","outputs","of","each","validation","step","."]
code: def on_validation_epoch_end(self, split="val"):
      """
      Called at the end of validation to aggregate outputs.
      :param outputs: list of individual outputs of each validation step.
      """
      avg_loss = torch.tensor(0)
      if split == "val":
          avg_loss = torch.stack(
              [x[f"val_loss"] for x in self.validation_step_outputs]
          ).mean()
          self.validation_step_outputs.clear()  # free memory
      elif split == "test":
          avg_loss = torch.stack(
              [x[f"test_loss"] for x in self.test_step_outputs]
          ).mean()
          self.test_step_outputs.clear()  # free memory
  
      # calculate metrics and classification report
      (
          precision,
          recall,
          f1,
          report,
      ) = self.classification_report.compute()
  
      logging.info(f"{split}_report: {report}")
  
      self.log(f"{split}_loss", avg_loss, prog_bar=True)
      self.log(f"{split}_precision", precision)
      self.log(f"{split}_f1", f1)
      self.log(f"{split}_recall", recall)
  
      self.classification_report.reset()
  
imports: import os
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import CrossEntropyLoss
  from nemo.collections.nlp.data.text_classification import TextClassificationDataset, calc_class_weights
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.modules.common import SequenceClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling the TextClassificationModel obj's underlying member method code with example usage: obj.on_validation_epoch_end(split) without return types