Fill
tensorflow C++ API
Creates a tensor filled with a scalar value.
Summary
This operation creates a tensor of shapedims
and 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:
Output
: The output tensor.
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
: ATensor
of typeint32
. 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
: Atensor
filled with a scalar value. (tensor
shape ->dims
,tensor
value ->value
)
Using Method
※ dims의 shape에 value의 값을 넣어서 tensor를 만든다. output의 모든 값은 value의 값으로 채워진다.