code: def conv_sequence_pt(
      in_channels: int,
      out_channels: int,
      relu: bool = False,
      bn: bool = False,
      **kwargs: Any,
  ) -> List[nn.Module]:
      """Builds a convolutional-based layer sequence
  
      >>> from torch.nn import Sequential
      >>> from doctr.models import conv_sequence
      >>> module = Sequential(conv_sequence(3, 32, True, True, kernel_size=3))
  
      Args:
      ----
          in_channels: number of input channels
          out_channels: number of output channels
          relu: whether ReLU should be used
          bn: should a batch normalization layer be added
          **kwargs: additional arguments to be passed to the convolutional layer
  
      Returns:
      -------
          list of layers
      """
      # No bias before Batch norm
      kwargs["bias"] = kwargs.get("bias", not bn)
      # Add activation directly to the conv if there is no BN
      conv_seq: List[nn.Module] = [
          nn.Conv2d(in_channels, out_channels, **kwargs)
      ]
  
      if bn:
          conv_seq.append(nn.BatchNorm2d(out_channels))
  
      if relu:
          conv_seq.append(nn.ReLU(inplace=True))
  
      return conv_seq
  
file_path: doctr/doctr/models/utils/pytorch.py
imports: import logging
  from typing import Any, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from doctr.utils.data import download_from_url
label_desc: Use image node_id 4 for calling a global function with example usage: conv_sequence_pt(in_channels, out_channels, relu, bn) and returns: conv_seq