Variables are deprecated since PyTorch 0.4, so you should use tensors directly now.
However, using it might not explain your issue, so could you add more information about your use case and, if possible, a code snippet showing this issue?