r"""Returns a tensor filled with zeros with the same shape and data type as input tensor. Args: inp(Tensor): input tensor from which to derive the output tensor shape. Return: a tensor having the same shape as input tensor and filled with zeros. Examples: >>> x
(inp: Tensor)
| 390 | |
| 391 | |
| 392 | def zeros_like(inp: Tensor) -> Tensor: |
| 393 | r"""Returns a tensor filled with zeros with the same shape and data type as input tensor. |
| 394 | |
| 395 | Args: |
| 396 | inp(Tensor): input tensor from which to derive the output tensor shape. |
| 397 | |
| 398 | Return: |
| 399 | a tensor having the same shape as input tensor and filled with zeros. |
| 400 | |
| 401 | Examples: |
| 402 | >>> x = F.arange(6, dtype='int32').reshape(2, 3) |
| 403 | >>> F.zeros_like(x) |
| 404 | Tensor([[0 0 0] |
| 405 | [0 0 0]], dtype=int32, device=xpux:0) |
| 406 | """ |
| 407 | return full_like(inp, 0.0) |
| 408 | |
| 409 | |
| 410 | def ones_like(inp: Tensor) -> Tensor: |
no test coverage detected