docstr: Aggregates predictions and targets.
  
  This function gets called every time `self.compute` is called, which is at every
  log iteration as well as the end of each epoch, e.g. train, val, valEMA.
  Logging happens at iteration 1 and every `common.log_freq` thereafter.
  
  Note: for computationally heavy metrics, you may want to increase `common.log_freq`.
docstr_tok: ["Aggregates","predictions","and","targets",".","This","function","gets","called","every","time","`","self.compute","`","is","called",",","which","is","at","every","log","iteration","as","well","as","the","end","of","each","epoch",",","e.g",".","train",",","val",",","valEMA",".","Logging","happens","at","iteration","1","and","every","`","common.log_freq","`","thereafter",".","Note",":","for","computationally","heavy","metrics",",","you","may","want","to","increase","`","common.log_freq","`","."]
code: def get_aggregates(self) -> Tuple[Tensor, Tensor]:
      """Aggregates predictions and targets.
  
      This function gets called every time `self.compute` is called, which is at every
      log iteration as well as the end of each epoch, e.g. train, val, valEMA.
      Logging happens at iteration 1 and every `common.log_freq` thereafter.
  
      Note: for computationally heavy metrics, you may want to increase `common.log_freq`.
      """
      self._predictions = [torch.cat(self._predictions, dim=0)]
      self._targets = [torch.cat(self._targets, dim=0)]
  
      return self._predictions[0], self._targets[0]
  
imports: import abc
  import argparse
  from numbers import Number
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from utils import logger
  from utils.tensor_utils import all_gather_list, reduce_tensor_sum, tensor_to_python_float
label_desc: Use image node_id 4 for calling the EpochMetric obj's underlying member method code with example usage: obj.get_aggregates() and returns: self,  self