Print the device of parameter

I want to print the device information of parameter such as w. How to do it . I use the command “print w”,but it do not contain the device information. Thanks a lot.

You could use print(w.device).