Hi,
I have such a simple method in my model
    def get_normal(self, std):
        if <here I need to know which device is used> :
            eps = torch.cuda.FloatTensor(std.size()).normal_()
        else:
            eps = torch.FloatTensor(std.size()).normal_()
        return Variable(eps).mul(std)

To work efficiently, it needs to know which device is currently used (CPU or GPU).
I was looking for something like model.is_cuda - but different tensors can be placed on different devices, so probably there is something like std.device_context, but I haven’t found such method either.
What is recommended to handle such situations?