parameters: (filter_shape, num_spatial_dims,
                                         rate_or_const_rate)
return_statement: return base_paddings
docstring: Helper function to compute base_paddings.
docstring_summary: Helper function to compute base_paddings.
docstring_tokens: Helper function to compute base_paddings .
function: def _with_space_to_batch_base_paddings(filter_shape, num_spatial_dims,
                                         rate_or_const_rate):
    """Helper function to compute base_paddings."""
    # Spatial dimensions of the filters and the upsampled filters in which we
    # introduce (rate - 1) zeros between consecutive filter values.
    filter_spatial_shape = filter_shape[:num_spatial_dims]
    pad_extra_shape = (filter_spatial_shape - 1) * rate_or_const_rate
  
    # When full_padding_shape is odd, we pad more at end, following the same
    # convention as conv2d.
    pad_extra_start = pad_extra_shape // 2
    pad_extra_end = pad_extra_shape - pad_extra_start
    base_paddings = array_ops.stack(
        [[pad_extra_start[i], pad_extra_end[i]] for i in range(num_spatial_dims)])
    return base_paddings
function_tokens: def _with_space_to_batch_base_paddings ( filter_shape , num_spatial_dims , rate_or_const_rate ) : # Spatial dimensions of the filters and the upsampled filters in which we # introduce (rate - 1) zeros between consecutive filter values. filter_spatial_shape = filter_shape [ : num_spatial_dims ] pad_extra_shape = ( filter_spatial_shape - 1 ) * rate_or_const_rate # When full_padding_shape is odd, we pad more at end, following the same # convention as conv2d. pad_extra_start = pad_extra_shape // 2 pad_extra_end = pad_extra_shape - pad_extra_start base_paddings = array_ops . stack ( [ [ pad_extra_start [ i ] , pad_extra_end [ i ] ] for i in range ( num_spatial_dims ) ] ) return base_paddings