@PistonY
Yes, you can. You can create a TensorOptions obj by passing both the device type and its device index, the default is -1 which means pytorch will always use the same single device. You can explicitly specify this (0,1,etc)
Here is an example:
/https://github.com/pytorch/pytorch/blob/5fd037ce4450d2a7bb477fa0f58677d7b256fdfe/test/cpp/api/tensor_cuda.cpp#L16 143’