text: import torch.nn as nn
  from .OmniConv2d import OmniConv2d
  from .OmniMaxPool2d import OmniMaxPool2d
  
  
  def converLayers(model):
      """
      convert all Conv, MaxPool layers to OmniConv, OmniMaxPool
      """
      for name, child in model.named_children():
          if isinstance(child, nn.Conv2d):
              # print("convert in={}, out={} conv".format(child.in_channels, child.out_channels))
              layer_new = OmniConv2d(child.in_channels, child.out_channels, child.kernel_size, child.stride,
                                     child.padding, child.dilation, child.groups,
                                     child.bias is not None, child.padding_mode)
              layer_new.weight = child.weight
              layer_new.bias = child.bias
              model._modules[name] = layer_new
          elif isinstance(child, nn.MaxPool2d):
              model._modules[name] = OmniMaxPool2d(child.kernel_size, child.stride, child.padding, child.dilation)
          else:
              if len(list(child.children())) > 0:
                  converLayers(child)
  
  class OmniLayerConverter():
      def __init__(self, target_model):
          self.model = target_model
          self.converLayers(self.model)
          return self.model
  
  
      def converLayers(self, model):
          """
          convert all Conv, MaxPool layers to OmniConv, OmniMaxPool
          """
          for name, child in model.named_children():
              if isinstance(child, nn.Conv2d):
                  # print("convert in={}, out={} conv".format(child.in_channels, child.out_channels))
                  layer_new = OmniConv2d(child.in_channels, child.out_channels, child.kernel_size, child.stride,
                                         child.padding, child.dilation, child.groups,
                                         child.bias is not None, child.padding_mode)
                  layer_new.weight = child.weight
                  layer_new.bias = child.bias
                  model._modules[name] = layer_new
              elif isinstance(child, nn.MaxPool2d):
                  model._modules[name] = OmniMaxPool2d(child.kernel_size, child.stride, child.padding, child.dilation)
              else:
                  if len(list(child.children())) > 0:
                      self.converLayers(child)