docstr: Test evaluation.
docstr_tok: ["Test","evaluation","."]
code: def test_full_eval(self, n_sequences=5):
      """Test evaluation."""
  
      # caching batch indices first to preserve RNG state
      seq_datasets = {}
      batch_indices = {}
      for seq in itertools.islice(
          self.dataset.sequence_names(), n_sequences
      ):
          idx = list(self.dataset.sequence_indices_in_order(seq))
          seq_dataset = torch.utils.data.Subset(self.dataset, idx)
          seq_datasets[seq] = seq_dataset
          batch_indices[seq] = self._get_random_batch_indices(
              seq_dataset
          )
  
      for model_class_type in ["ModelDBIR", "GenericModel"]:
          ModelClass = registry.get(
              ImplicitronModelBase, model_class_type
          )
          expand_args_fields(ModelClass)
          model = ModelClass(
              render_image_width=self.image_size,
              render_image_height=self.image_size,
              bg_color=self.bg_color,
          )
          model.eval()
          model.cuda()
  
          for seq in itertools.islice(
              self.dataset.sequence_names(), n_sequences
          ):
              self._one_sequence_test(
                  seq_datasets[seq],
                  model,
                  batch_indices[seq],
                  check_metrics=(model_class_type == "ModelDBIR"),
              )
  
imports: import contextlib
  import dataclasses
  import itertools
  import math
  import os
  import unittest
  import lpips
  import numpy
  import torch
  from pytorch3d.implicitron.dataset.frame_data import FrameData
  from pytorch3d.implicitron.dataset.json_index_dataset import JsonIndexDataset
  from pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis import eval_batch
  from pytorch3d.implicitron.models.base_model import ImplicitronModelBase
  from pytorch3d.implicitron.models.generic_model import GenericModel
  from pytorch3d.implicitron.models.model_dbir import ModelDBIR
  from pytorch3d.implicitron.tools.config import expand_args_fields, registry
  from pytorch3d.implicitron.tools.metric_utils import calc_psnr, eval_depth
  from pytorch3d.implicitron.tools.utils import dataclass_to_cuda_
  from .common_resources import get_skateboard_data, provide_lpips_vgg
label_desc: Use image node_id 7 for calling the TestEvaluation obj's underlying member method code with example usage: obj.test_full_eval(n_sequences) without return types