code: def get_padding_shape(
      pad_mode,
      input_spatial_shape,
      kernel_spatial_shape,
      strides_spatial,
  ):
      """
      return padding shape of conv2d or pooling,
      Args:
          pad_mode: string
          kernel_spatial_shape: list[int]
          strides_spatial: list[int]
      Returns:
          list[int]
      """
      output_spatial_shape = get_output_shape(
          pad_mode,
          input_spatial_shape,
          kernel_spatial_shape,
          strides_spatial,
      )
      pad_shape = (
          [0] * len(input_spatial_shape) * 2
      )  # 2 means left and right
      # the odd paddding is the value that cannot be handled by the tuple padding (w, h) mode
      # so we need to firstly handle the input, then use the nomal padding method.
      odd_padd_shape = [0] * len(input_spatial_shape) * 2
      for i in range(len(input_spatial_shape)):
          whole_pad = (
              (output_spatial_shape[i] - 1) * strides_spatial[i]
              + kernel_spatial_shape[i]
              - input_spatial_shape[i]
          )
          pad_shape[2 * i] = pad_shape[2 * i + 1] = whole_pad // 2
          if whole_pad % 2 != 0:
              if pad_mode == "SAME_UPPER":
                  odd_padd_shape[2 * i + 1] += 1
              else:
                  odd_padd_shape[2 * i] += 1
      return pad_shape, odd_padd_shape
  
file_path: singa/python/singa/utils.py
imports: import sys
  import numpy
  import collections
  from .None import singa_wrap
label_desc: Use image node_id 6 for calling a global function with example usage: get_padding_shape(pad_mode, input_spatial_shape, kernel_spatial_shape, strides_spatial) and returns: pad_shape,  odd_padd_shape