Learn R Programming

rTorch (version 0.4.2)

as_boolean: Convert tensor to boolean type

Description

Convert a tensor to a boolean equivalent tensor

Usage

as_boolean(x)

Arguments

x

a torch tensor

Examples

Run this code
# NOT RUN {
uo <- torch$ones(3L)
as_boolean(uo)              # tensor([True, True, True], dtype=torch.bool)
# }

Run the code above in your browser using DataLab