docs: def _pad_input(self, inputs):
      """Pad input in case the desired padding type requires it.
  
      VALID and SAME padding types are directly supported by tensorflow
      convolution ops, so don't require us to pad input ourselves, at least
      in cases where the same method is used for all dimensions.
  
      Other padding types (FULL, CAUSAL, REVERSE_CAUSAL) aren't directly supported
      by conv ops but can be implemented by using VALID and padding the input
      appropriately ourselves.
  
      If different padding types are used for different dimensions, we use VALID
      but pad the input ourselves along any dimensions that require other padding
      types.
  
      Args:
        inputs: A Tensor of shape `data_format` and of type `tf.float16`,
            `tf.bfloat16` or `tf.float32`.
  
      Returns:
        inputs: The `inputs` argument that has had any required padding added.
      """
      if all(p == self._conv_op_padding for p in self._padding):
        # All axes require the same padding type that we're going to use for the
        # underlying convolution op, so nothing needs to be done:
        return inputs
  
      # In all other cases we use VALID as the underlying padding type, and for
      # the axes which require something other than VALID, we pad inputs ourselves
      # before the convolution.
      assert self._conv_op_padding == VALID
  
      def pad_amount(kernel_size, rate, padding):
        """Pre- and post-padding required for a particular axis before conv op."""
        # The effective kernel size includes any holes/gaps introduced by the
        # dilation rate. It's equal to kernel_size when rate == 1.
        effective_kernel_size = int((kernel_size - 1) * rate + 1)
        if padding == FULL:
          return [effective_kernel_size - 1, effective_kernel_size - 1]
        if padding == CAUSAL:
          return [effective_kernel_size - 1, 0]
        if padding == REVERSE_CAUSAL:
          return [0, effective_kernel_size - 1]
        if padding == SAME:
          return [(effective_kernel_size - 1) // 2, effective_kernel_size // 2]
        # padding == VALID
        return [0, 0]
  
      paddings = map(pad_amount, self._kernel_shape, self._rate, self._padding)
      if self._data_format.startswith("NC"):  # N, C, ...
        paddings = [[0, 0], [0, 0]] + list(paddings)
      else:  # N, ..., C
        paddings = [[0, 0]] + list(paddings) + [[0, 0]]
  
      return tf.pad(inputs, paddings)