code: def compute_pads_2d(operation, layer):
      auto_pad = get_onnx_attribute(operation, "auto_pad", "NOTSET")
      if auto_pad != "NOTSET":
          # Height
          if layer["in_height"] % layer["stride_height"] == 0:
              pad_along_height = max(
                  layer["filt_height"] - layer["stride_height"], 0
              )
          else:
              pad_along_height = max(
                  layer["filt_height"]
                  - (layer["in_height"] % layer["stride_height"]),
                  0,
              )
          pad_height = [
              pad_along_height // 2,
              pad_along_height - pad_along_height // 2,
          ]
  
          # Width
          if layer["in_width"] % layer["stride_width"] == 0:
              pad_along_width = max(
                  layer["filt_width"] - layer["stride_width"], 0
              )
          else:
              pad_along_width = max(
                  layer["filt_width"]
                  - (layer["in_width"] % layer["stride_width"]),
                  0,
              )
          pad_width = [
              pad_along_width // 2,
              pad_along_width - pad_along_width // 2,
          ]
  
          if auto_pad == "SAME_UPPER":
              pads = [
                  min(pad_height),
                  min(pad_width),
                  max(pad_height),
                  max(pad_width),
              ]
          elif auto_pad == "SAME_LOWER":
              pads = [
                  max(pad_height),
                  max(pad_width),
                  min(pad_height),
                  min(pad_width),
              ]
          else:  # 'VALID' padding
              pads = [0, 0, 0, 0]
      else:
          pads = get_onnx_attribute(operation, "pads", [0, 0, 0, 0])
  
      return pads
  
imports: import numpy
  import onnx
  from onnx import helper, numpy_helper, shape_inference
  from hls4ml.model import ModelGraph
label_desc: Use image node_id 6 for calling a global function with example usage: compute_pads_2d(operation, layer) and returns: pads