code: def test_swin_encoder(encoder, encoder_params):
      net = encoder(**encoder_params).change_input_channels(5).eval()
      output_spec = net.get_output_spec()
  
      print(net.__class__.__name__, count_parameters(net))
      print(output_spec)
  
      x = torch.rand((4, 5, 256, 256))
      x = maybe_cuda(x)
      net = maybe_cuda(net)
      output = net(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 11 for calling a global function with example usage: test_swin_encoder(encoder, encoder_params) without return types