code: def test_unet_encoder():
      net = E.UnetEncoder().eval()
      print(net.__class__.__name__, count_parameters(net))
      print(net.strides)
      print(net.channels)
      x = torch.rand((4, 3, 256, 256))
      x = maybe_cuda(x)
      net = maybe_cuda(net)
      output = net(x)
      assert len(output) == len(net.channels)
      for feature_map, expected_stride, expected_channels in zip(
          output, net.strides, net.channels
      ):
          print(
              feature_map.size(), feature_map.mean(), feature_map.std()
          )
          assert feature_map.size(1) == expected_channels
          assert feature_map.size(2) * expected_stride == 256
          assert feature_map.size(3) * expected_stride == 256
  
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 3 for calling a global function with example usage: test_unet_encoder() without return types