code: def test_mit_encoder(encoder, encoder_params):
      encoder: AbstractEncoder = (
          encoder(**encoder_params).change_input_channels(5).eval()
      )
      print(
          encoder.__class__.__name__,
          count_parameters(encoder, human_friendly=True),
      )
  
      output_spec = encoder.get_output_spec()
      print(encoder.get_output_spec())
      x = torch.rand((4, 5, 256, 256))
      x = maybe_cuda(x)
      encoder = maybe_cuda(encoder)
      output = encoder(x)
  
      assert len(output) == len(output_spec.channels)
  
      for feature_map, expected_stride, expected_channels in zip(
          output, output_spec.strides, output_spec.channels
      ):
          assert feature_map.size(1) == expected_channels
          assert feature_map.size(2) * expected_stride == x.size(2)
          assert feature_map.size(3) * expected_stride == x.size(3)
  
file_path: pytorch-toolbelt/tests/test_encoders.py
imports: import pytest
  import torch
  import pytorch_toolbelt.modules.encoders
  from pytorch_toolbelt.modules import AbstractEncoder
  from pytorch_toolbelt.modules.backbone.inceptionv4 import inceptionv4
  from pytorch_toolbelt.utils.torch_utils import maybe_cuda, count_parameters, describe_outputs
  from pytorch_toolbelt.modules.encoders import timm
label_desc: Use image node_id 12 for calling a global function with example usage: test_mit_encoder(encoder, encoder_params) without return types