code: def same_pad_shape_check(handle, pad_mode, x):
      """
      check the shape is correct for same padding mode
      Args:
          handle, the handle
          pad_mode, pad_mode
          x: input tensor
      Returns:
          tuple, the correct padding(before divide 2)
      """
      _kernel = [handle.kernel_h, handle.kernel_w]
      _stride = [handle.stride_h, handle.stride_w]
      _padding = [handle.pad_h, handle.pad_w]
      _padding_correct = get_padding_shape(
          pad_mode, x.shape()[2:], _kernel, _stride
      )
      _padding_crop, _ = [x // 2 for x in _padding_correct]
      assert _padding == _padding_crop, (
          "For a same mode, the given padding %s is wrong, the correct one should be %s."
          % (_padding, _padding_crop)
      )
      return _padding_correct
  
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 4 for calling a global function with example usage: same_pad_shape_check(handle, pad_mode, x) and returns: _padding_correct