Pad


tensorflow C++ API

tensorflow::ops::Pad

Pads a tensor with zeros.


Summary

This operation pads ainputwith zeros according to thepaddingsyou specify.paddingsis an integer tensor with shape[Dn, 2], where n is the rank ofinput. For each dimension D ofinput,paddings[D, 0]indicates how many zeros to add before the contents ofinputin that dimension, andpaddings[D, 1]indicates how many zeros to add after the contents ofinputin that dimension.

The padded size of each dimension D of the output is:

paddings(D, 0) + input.dim_size(D) + paddings(D, 1)

For example:

``` 't' is [[1, 1], [2, 2]]

'paddings' is [[1, 1], [2, 2]]

rank of 't' is 2

pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0] [0, 0, 1, 1, 0, 0] [0, 0, 2, 2, 0, 0] [0, 0, 0, 0, 0, 0]] ```

Arguments:

Returns:


Pad block

Source link :https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_array_ops.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input input: A tensor.
  • Input paddings: is an integer tensor with shape [Dn, 2], where n is the rank of input

Output:

  • Output y: Output object of Pad class object.

Result:

  • std::vector(Tensor) result_output: A Tensor . Pads a tensor fill with zeros.

Using Method

results matching ""

    No results matching ""