I would recommend setting up one of the basic examples that Pytorch has, like mnist, and then looking through it to understand how all of the components fit together. Use print statements to see if data is a Variable or a Tensor. Try breaking it to understand how it works and why it sometimes doesn’t work.
Also, make sure you read and understand this 5. There’s a bunch of good documentation on the site.
What do you mean by “why the input variable can not be recognized as a variable”? Please post examples and errors when you run into issues.