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

negrinho picture negrinho  路  3Comments

eliabruni picture eliabruni  路  3Comments

soumith picture soumith  路  3Comments

SeparateReality picture SeparateReality  路  3Comments

a1363901216 picture a1363901216  路  3Comments