Skip to content

backward failing when using expand #249

@glample

Description

@glample

The following code will raise an issue:

x = Variable(torch.FloatTensor(10, 7).normal_(), requires_grad=True)
y = Variable(torch.FloatTensor(10, 7).normal_())
x -= x.mean(1).expand(x.size())

nn.MSELoss()(x, y).backward()

RuntimeError: inconsistent tensor size at /home/guismay/pytorch-master/torch/lib/TH/generic/THTensorMath.c:576

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions