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, outputs: List[Dict]) -> Dict:
      """
      Called at the end of validation to aggregate outputs.
      :param outputs: list of individual outputs of each validation step.
      """
      avg_loss = torch.stack([x["val_loss"] for x in outputs]).mean()
      perplexity = self.validation_perplexity.compute()
      tensorboard_logs = {
          "val_loss": avg_loss,
          "perplexity": perplexity,
      }
      logging.info(f"evaluation perplexity {perplexity.item()}")
      self.log("val_loss", avg_loss)
      return {"val_loss": avg_loss, "log": tensorboard_logs}
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from transformers import AutoModel, BartForConditionalGeneration, EncoderDecoderModel
  from nemo.collections.common.metrics import Perplexity
  from nemo.collections.nlp.data.text2sparql import Text2SparqlDataset
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.modelPT import ModelPT
  from nemo.core.neural_types import ChannelType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 7 for calling the Text2SparqlModel obj's underlying member method code with example usage: obj.on_validation_epoch_end(outputs) and returns: dict