Hi,
I think the best practice is to just remove all Variables and .data from your code.
Variables are not needed anymore and you can pass requires_grad=True when you create a tensor if needed.
The .data should be replaced by either .detach() if the goal is to prevent gradient from flowing back. Or move operations inside a with torch.no_grad(): block if the goal is to perform operations not tracked by the autograd engine.
The error you’re seeing is most likely due to a change in the Variable wrapping and .data semantics. Removing them with the right tool should fix it