-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
torch.Tensor(1,1).expand(1,2).view(1,2)
Traceback (most recent call last):
File "", line 1, in
RuntimeError: invalid argument 1: input is not contiguous at /pytorch/torch/lib/TH/generic/THTensor.c:231
There are two problems:
- view of the same size as the input should always succeed, regardless continuity
- an expanded scalar is of course contiguous, no?
I think these are bugs.
As a feature request, may I suggest that some of the reshaping should also succeed on non-contiguous Tensors as long as only dimensions that are contiguous are affected. Examples:
size (4,4, X), strides (1,4, Y) -> size (16, X), stride (1, Y)
Metadata
Metadata
Assignees
Labels
No labels