mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
make tensor.expand create a tensor from correct type, not default type.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user