docstr: Tests the task in test mode by running train_steps
  to make sure the train_steps run as expected on a
  test_only task
code: def test_test_only_task(self):
      """
      Tests the task in test mode by running train_steps
      to make sure the train_steps run as expected on a
      test_only task
      """
      test_config = get_fast_test_task_config()
      test_config["test_only"] = True
  
      # delete train dataset
      del test_config["dataset"]["train"]
  
      test_only_task = build_task(test_config).set_hooks(
          [LossLrMeterLoggingHook()]
      )
  
      test_only_task.prepare()
      test_state = test_only_task.get_classy_state()
  
      # We expect that test only state is test, no matter what train state is
      self.assertFalse(test_state["train"])
  
      # Num updates should be 0
      self.assertEqual(test_state["num_updates"], 0)
  
      # Verify task will run
      trainer = LocalTrainer()
      trainer.train(test_only_task)
  
imports: import copy
  import itertools
  import shutil
  import tempfile
  import unittest
  import torch
  import torch.nn
  from classy_vision.dataset import build_dataset
  from classy_vision.generic.distributed_util import is_distributed_training_run
  from classy_vision.generic.util import get_checkpoint_dict, get_torch_version
  from classy_vision.hooks import CheckpointHook, LossLrMeterLoggingHook
  from classy_vision.losses import build_loss, ClassyLoss, register_loss
  from classy_vision.models import build_model, ClassyModel
  from classy_vision.optim import build_optimizer, SGD
  from classy_vision.tasks import build_task, ClassificationTask
  from classy_vision.trainer import LocalTrainer
  from test.generic.config_utils import get_fast_test_task_config, get_test_task_config
  from test.generic.utils import compare_model_state, compare_samples, compare_states, LimitedPhaseTrainer
label_desc: Use image node_id 14 for calling the TestClassificationTask obj's underlying member method code with example usage: obj.test_test_only_task() without return types