mindspore.ops.zeros_like

View Source On Gitee
mindspore.ops.zeros_like(input, *, dtype=None)[source]

Return a tensor filled with 0, with the same size as input .

Parameters

input (Tensor) – The input tensor.

Keyword Arguments

dtype (mindspore.dtype, optional) – The data type specified. Default None represents the same data type as the input.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.ops.arange(4)
>>> mindspore.ops.zeros_like(input)
Tensor(shape=[4], dtype=Int64, value= [0, 0, 0, 0])