code: def subnet_conv_func(
      kernel_size: int, hidden_ratio: float
  ) -> Callable:
      """Subnet Convolutional Function.
  
      Callable class or function ``f``, called as ``f(channels_in, channels_out)`` and
          should return a torch.nn.Module.
          Predicts coupling coefficients :math:`s, t`.
  
      Args:
          kernel_size (int): Kernel Size
          hidden_ratio (float): Hidden ratio to compute number of hidden channels.
  
      Returns:
          Callable: Sequential for the subnet constructor.
      """
  
      def subnet_conv(
          in_channels: int, out_channels: int
      ) -> nn.Sequential:
          hidden_channels = int(in_channels * hidden_ratio)
          # NOTE: setting padding="same" in nn.Conv2d breaks the onnx export so manual padding required.
          # TODO: Use padding="same" in nn.Conv2d once PyTorch v2.1 is released
          padding = 2 * (
              kernel_size // 2 - ((1 + kernel_size) % 2),
              kernel_size // 2,
          )
          return nn.Sequential(
              nn.ZeroPad2d(padding),
              nn.Conv2d(in_channels, hidden_channels, kernel_size),
              nn.ReLU(),
              nn.ZeroPad2d(padding),
              nn.Conv2d(hidden_channels, out_channels, kernel_size),
          )
  
      return subnet_conv
  
file_path: anomalib/src/anomalib/models/fastflow/torch_model.py
imports: from __future__ import annotations
  from typing import Callable
  import timm
  import torch
  from FrEIA.framework import SequenceINN
  from timm.models.cait import Cait
  from timm.models.vision_transformer import VisionTransformer
  from torch import Tensor, nn
  from anomalib.models.components.flow import AllInOneBlock
  from anomalib.models.fastflow.anomaly_map import AnomalyMapGenerator
label_desc: Use image node_id 1 for calling a global function with example usage: subnet_conv_func(kernel_size, hidden_ratio) and returns: subnet_conv, nn