There is a function in pytorch to set the default cuda device. But I cannot find something similar in libtorch. Can someone help me out here?
Iām unsure if you can set the default device globally, but you could use the CUDAGuard()
inside your method instead:
CUDAGuard device_guard(device);
which makes sure to use the specified device
id.
(Thanks @tom for clarification )
1 Like
Thanks for the tip