Skip to content

Commit

Permalink
Update content/pytorch/concepts/tensor-operations/terms/is-nonzero/is…
Browse files Browse the repository at this point in the history
…-nonzero.md
  • Loading branch information
avdhoottt authored Feb 12, 2025
1 parent ccf1eac commit 4be1772
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ torch.is_nonzero(input)

## Example

This code demonstrates how PyTorch's `.is_nonzero()` function checks whether a tensor contains a non-zero value, returning `True` for `tensor1 (5.0)` and `False` for `tensor2 (0.0)`:
This code demonstrates how PyTorch's `.is_nonzero()` function checks whether a tensor contains a non-zero value:

```py
import torch
Expand Down

0 comments on commit 4be1772

Please sign in to comment.