Apparently x.shape works if x is a tensor, but not if it is a Variable.
It is possible to do x.data.shape and x.size() is x is a Variable, but not x.shape
This should be the same for consistency, no matter if Variable or Tensor.
This has just been fixed on master, and will be present in the next release https://github.com/pytorch/pytorch/pull/2306
What is the next release, 0.3 or 0.2.x?
@acgtyrant probably 0.2.x
Most helpful comment
This has just been fixed on master, and will be present in the next release https://github.com/pytorch/pytorch/pull/2306