Libtorch. Get device of class inside the class

Hello i need to get device of class instance inside the class and then use this device for another tensor, created in this class. How i can do it in c++?

Example
class …
auto forward()
{
torch::Tensor a = torch::zeros({1,}).to(this.device);
}