code: def _grad_input_padding(
      grad_output,
      input_size,
      stride,
      padding,
      kernel_size,
      dilation=None,
  ):
      if dilation is None:
          # For backward compatibility
          dilation = [1] * len(stride)
  
      input_size = list(input_size)
      k = grad_output.dim() - 2
  
      if len(input_size) == k + 2:
          input_size = input_size[-k:]
      if len(input_size) != k:
          raise ValueError(
              "input_size must have {} elements (got {})".format(
                  k + 2, len(input_size)
              )
          )
  
      def dim_size(d):
          return (
              (grad_output.size(d + 2) - 1) * stride[d]
              - 2 * padding[d]
              + 1
              + dilation[d] * (kernel_size[d] - 1)
          )
  
      min_sizes = [dim_size(d) for d in range(k)]
      max_sizes = [min_sizes[d] + stride[d] - 1 for d in range(k)]
      for size, min_size, max_size in zip(
          input_size, min_sizes, max_sizes
      ):
          if size < min_size or size > max_size:
              raise ValueError(
                  (
                      "requested an input grad size of {}, but valid sizes range "
                      "from {} to {} (for a grad_output of {})"
                  ).format(
                      input_size,
                      min_sizes,
                      max_sizes,
                      grad_output.size()[2:],
                  )
              )
  
      return tuple(input_size[d] - min_sizes[d] for d in range(k))
  
file_path: FATE/python/fate/arch/protocol/mpc/common/util.py
imports: import functools
  import numpy
  import torch
  from fate.arch.protocol.mpc.cuda import CUDALongTensor
label_desc: Use image node_id 5 for calling a global function with example usage: _grad_input_padding(grad_output, input_size, stride, padding, kernel_size, dilation) and returns: tuple, unknown