ZerosLike
tensorflow C++ API
Returns a tensor of zeros with the same shape and type as x.
Summary
For example:
# 'tensor' is [[1, 2, 3], [4, 5, 6]]
tf.zeros_like(tensor)==>[[0,0,0],[0,0,0]]
Arguments:
- scope: A Scope object
- x: a tensor of type T.
Returns:
Output
: a tensor of the same shape and type as x but filled with zeros.
ZerosLike 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 x: A
Tensor
.
Output:
- Output y: Output object of ZerosLike class object.
Result:
- std::vector(Tensor)
result_y
: ATensor
with all elements set to zero.
Using Method
※ x로 들어온 모든 값을 0으로 만든다. 위 그림에서는 들어온 tensor의 type이 boolean타입이므로 모든 값이 false로 바뀐다.