Pytorch: 'Variable' object has no attribute 'shape' [v0.2]

Created on 7 Aug 2017  ·  3Comments  ·  Source: pytorch/pytorch

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.

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

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdluminate picture cdluminate  ·  3Comments

szagoruyko picture szagoruyko  ·  3Comments

eliabruni picture eliabruni  ·  3Comments

soumith picture soumith  ·  3Comments

soumith picture soumith  ·  3Comments