Description Usage Arguments Value Examples
Returns True if any elements in the tensor are non-zero, False otherwise.
1 2 |
x |
tensor |
dim |
dimension to reduce |
... |
other params (yet to be developed) |
A tensor of type torch.uint8 representing the boolean result: 1 for TRUE and 0 for FALSE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
a <- torch$BoolTensor(list(TRUE, TRUE, TRUE, TRUE))
b <- torch$BoolTensor(list(FALSE, TRUE, TRUE, TRUE))
c <- torch$BoolTensor(list(TRUE, TRUE, TRUE, FALSE))
any(a)
any(b)
any(c)
d <- torch$tensor(list(list(1, 0),
list(0, 0),
list(0, 1),
list(0, 0)), dtype=torch$uint8)
any(d)
any(d, dim=0L)
any(d, dim=1L)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.