Skip to contents

Default torch device

Usage

default_device()

Value

Returns torch::torch_device("cuda") if torch::cuda_is_available(), or torch::torch_device("cpu") otherwise.

Examples

device <- default_device()