code: def conv_forward(
      inputs: torch.Tensor,
      conv_module: Union[nn.Conv1d, nn.Conv2d, nn.Conv3d],
      weight: torch.Tensor,
      bias: Optional[torch.Tensor],
  ) -> Tensor:
      assert isinstance(
          conv_module, (nn.Conv1d, nn.Conv2d, nn.Conv3d)
      ), f"expected module type in [Conv1d, Conv2d, Conv3d], but got {type(conv_module)}"
  
      def conv_forward_func(conv_func, padding_func):
          # copied from torch
          if conv_module.padding_mode != "zeros":
              return conv_func(
                  F.pad(
                      inputs,
                      reversed_padding_repeated_twice(conv_module),
                      mode=conv_module.padding_mode,
                  ),
                  weight,
                  bias,
                  conv_module.stride,
                  padding_func(0),
                  conv_module.dilation,
                  conv_module.groups,
              )
          return conv_func(
              inputs,
              weight,
              bias,
              conv_module.stride,
              conv_module.padding,
              conv_module.dilation,
              conv_module.groups,
          )
  
      if type(conv_module) == torch.nn.Conv1d:
          return conv_forward_func(F.conv1d, _single)
      elif type(conv_module) == torch.nn.Conv2d:
          return conv_forward_func(F.conv2d, _pair)
      elif type(conv_module) == torch.nn.Conv3d:
          return conv_forward_func(F.conv3d, _triple)
      else:
          raise TypeError(
              f"Only support modules in [conv1d, conv2d, conv3d], but got {type(conv_module)}"
          )
  
imports: from typing import Dict, Union, Tuple, Callable, Optional
  from collections.abc import Iterable
  from itertools import repeat
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from .target_space import TargetType
label_desc: Use image node_id 4 for calling a global function with example usage: conv_forward(inputs, conv_module, weight, bias) and returns: conv_func, conv_forward_func, conv_func, conv_forward_func, conv_forward_func