parameters: (tensor, paddings, mode="CONSTANT", name=None)
docstring: Pads a tensor.
  
    This operation pads a `tensor` according to the `paddings` you specify.
    `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of
    `tensor`. For each dimension D of `input`, `paddings[D, 0]` indicates how
    many values to add before the contents of `tensor` in that dimension, and
    `paddings[D, 1]` indicates how many values to add after the contents of
    `tensor` in that dimension. If `mode` is "REFLECT" then both `paddings[D, 0]`
    and `paddings[D, 1]` must be no greater than `tensor.dim_size(D) - 1`. If
    `mode` is "SYMMETRIC" then both `paddings[D, 0]` and `paddings[D, 1]` must be
    no greater than `tensor.dim_size(D)`.
  
    The padded size of each dimension D of the output is:
  
    `paddings[D, 0] + tensor.dim_size(D) + paddings[D, 1]`
  
    For example:
  
    ```python
    # 't' is [[1, 2, 3], [4, 5, 6]].
    # 'paddings' is [[1, 1,], [2, 2]].
    # rank of 't' is 2.
    pad(t, paddings, "CONSTANT") ==> [[0, 0, 0, 0, 0, 0, 0],
                                      [0, 0, 1, 2, 3, 0, 0],
                                      [0, 0, 4, 5, 6, 0, 0],
                                      [0, 0, 0, 0, 0, 0, 0]]
  
    pad(t, paddings, "REFLECT") ==> [[6, 5, 4, 5, 6, 5, 4],
                                     [3, 2, 1, 2, 3, 2, 1],
                                     [6, 5, 4, 5, 6, 5, 4],
                                     [3, 2, 1, 2, 3, 2, 1]]
  
    pad(t, paddings, "SYMMETRIC") ==> [[2, 1, 1, 2, 3, 3, 2],
                                       [2, 1, 1, 2, 3, 3, 2],
                                       [5, 4, 4, 5, 6, 6, 5],
                                       [5, 4, 4, 5, 6, 6, 5]]
    ```
  
    Args:
      tensor: A `Tensor`.
      paddings: A `Tensor` of type `int32`.
      mode: One of "CONSTANT", "REFLECT", or "SYMMETRIC".
      name: A name for the operation (optional).
  
    Returns:
      A `Tensor`. Has the same type as `tensor`.
  
    Raises:
      ValueError: When mode is not one of "CONSTANT", "REFLECT", or "SYMMETRIC".
docstring_summary: Pads a tensor.
docstring_tokens: Pads a tensor .
function: def pad(tensor, paddings, mode="CONSTANT", name=None):  # pylint: disable=invalid-name
    """Pads a tensor.
  
    This operation pads a `tensor` according to the `paddings` you specify.
    `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of
    `tensor`. For each dimension D of `input`, `paddings[D, 0]` indicates how
    many values to add before the contents of `tensor` in that dimension, and
    `paddings[D, 1]` indicates how many values to add after the contents of
    `tensor` in that dimension. If `mode` is "REFLECT" then both `paddings[D, 0]`
    and `paddings[D, 1]` must be no greater than `tensor.dim_size(D) - 1`. If
    `mode` is "SYMMETRIC" then both `paddings[D, 0]` and `paddings[D, 1]` must be
    no greater than `tensor.dim_size(D)`.
  
    The padded size of each dimension D of the output is:
  
    `paddings[D, 0] + tensor.dim_size(D) + paddings[D, 1]`
  
    For example:
  
    ```python
    # 't' is [[1, 2, 3], [4, 5, 6]].
    # 'paddings' is [[1, 1,], [2, 2]].
    # rank of 't' is 2.
    pad(t, paddings, "CONSTANT") ==> [[0, 0, 0, 0, 0, 0, 0],
                                      [0, 0, 1, 2, 3, 0, 0],
                                      [0, 0, 4, 5, 6, 0, 0],
                                      [0, 0, 0, 0, 0, 0, 0]]
  
    pad(t, paddings, "REFLECT") ==> [[6, 5, 4, 5, 6, 5, 4],
                                     [3, 2, 1, 2, 3, 2, 1],
                                     [6, 5, 4, 5, 6, 5, 4],
                                     [3, 2, 1, 2, 3, 2, 1]]
  
    pad(t, paddings, "SYMMETRIC") ==> [[2, 1, 1, 2, 3, 3, 2],
                                       [2, 1, 1, 2, 3, 3, 2],
                                       [5, 4, 4, 5, 6, 6, 5],
                                       [5, 4, 4, 5, 6, 6, 5]]
    ```
  
    Args:
      tensor: A `Tensor`.
      paddings: A `Tensor` of type `int32`.
      mode: One of "CONSTANT", "REFLECT", or "SYMMETRIC".
      name: A name for the operation (optional).
  
    Returns:
      A `Tensor`. Has the same type as `tensor`.
  
    Raises:
      ValueError: When mode is not one of "CONSTANT", "REFLECT", or "SYMMETRIC".
    """
  
    if mode == "CONSTANT":
      return gen_array_ops._pad(tensor, paddings, name=name)
    if mode == "REFLECT":
      return gen_array_ops._mirror_pad(tensor,
                                       paddings,
                                       mode="REFLECT",
                                       name=name)
    if mode == "SYMMETRIC":
      return gen_array_ops._mirror_pad(tensor,
                                       paddings,
                                       mode="SYMMETRIC",
                                       name=name)
    raise ValueError("Unknown padding mode: %s" % mode)
function_tokens: def pad ( tensor , paddings , mode = "CONSTANT" , name = None ) : # pylint: disable=invalid-name if mode == "CONSTANT" : return gen_array_ops . _pad ( tensor , paddings , name = name ) if mode == "REFLECT" : return gen_array_ops . _mirror_pad ( tensor , paddings , mode = "REFLECT" , name = name ) if mode == "SYMMETRIC" : return gen_array_ops . _mirror_pad ( tensor , paddings , mode = "SYMMETRIC" , name = name ) raise ValueError ( "Unknown padding mode: %s" % mode )