code: def test_pretrain_consistency(self, model, input_param, input_shape):
      example = torch.randn(input_shape).to(device)
      with skip_if_downloading_fails():
          net = model(**input_param).to(device)
      with eval_mode(net):
          result = net.features.forward(example)
      torchvision_net = torchvision.models.densenet121(
          pretrained=True
      ).to(device)
      with eval_mode(torchvision_net):
          expected_result = torchvision_net.features.forward(example)
      self.assertTrue(torch.all(result == expected_result))
  
file_path: MONAI/tests/test_densenet.py
imports: from __future__ import annotations
  import unittest
  from typing import TYPE_CHECKING
  from unittest import skipUnless
  import torch
  from parameterized import parameterized
  from monai.networks import eval_mode
  from monai.networks.nets import DenseNet121, Densenet169, DenseNet264, densenet201
  from monai.utils import optional_import
  from tests.utils import skip_if_downloading_fails, skip_if_quick, test_script_save
label_desc: Use image node_id 2 for calling the TestPretrainedDENSENET obj's underlying member method code with example usage: obj.test_pretrain_consistency(model, input_param, input_shape) without return types