make tensor.expand create a tensor from correct type, not default type.

This commit is contained in:
koray kavukcuoglu
2013-02-11 16:50:16 +00:00
parent a3289c4f51
commit e098ae1382

View File

@ -310,7 +310,7 @@ function Tensor.expand(tensor,...)
end
-- create new view, with singleton expansion:
tensor = torch.Tensor(tensor:storage(), tensor:storageOffset(),
tensor = tensor.new(tensor:storage(), tensor:storageOffset(),
tensor_size, tensor_stride)
return tensor
end