Fill


tensorflow C++ API

tensorflow::ops::Fill

Creates a tensor filled with a scalar value.


Summary

This operation creates a tensor of shapedimsand fills it withvalue.

For example:

```Outputtensor has shape [2, 3].

fill([2, 3], 9) ==> [[9, 9, 9] [9, 9, 9]] ```

Arguments:

  • scope: A Scope object
  • dims: 1-D. Represents the shape of the output tensor.
  • value: 0-D (scalar). Value to fill the returned tensor.

(numpy) Equivalent to np.full

Returns:


Fill 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 dims : A Tensor of type int32. 1-D. Represents the shape of the output tensor.
  • Input value: ATensor. 0-D (scalar). Value to fill the returned tensor.

Output:

  • output : Output object of Fill class object.

Result:

  • std::vector(Tensor) result_output: A tensor filled with a scalar value. ( tensorshape -> dims, tensor value -> value)

Using Method

※ dims의 shape에 value의 값을 넣어서 tensor를 만든다. output의 모든 값은 value의 값으로 채워진다.

results matching ""

    No results matching ""