-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
torch.repeatTensor() doesn't work with non-contiguous Tensor #59
Comments
is the matrix here contiguous? Can you post a code snippet to reproduce the issue? |
I cropped the first column of an image, therefore no, data are not contiguous. require 'image'
lena = image.lena()
lenaColumn = lena[{ {},{1,5},{1} }]
= lenaColumn
= lenaColumn:repeatTensor(1,1,2) which outputs (1,.,.) =
0.7569
0.7686
0.7804
0.7843
0.7843
(2,.,.) =
0.4353
0.4471
0.4510
0.4549
0.4549
(3,.,.) =
0.2902
0.3020
0.3059
0.3137
0.3216
[torch.DoubleTensor of dimension 3x5x1]
(1,.,.) =
0.7569 0.7569
0.7765 0.7765
0.7647 0.7647
0.7647 0.7647
0.7843 0.7843
(2,.,.) =
0.7882 0.7882
0.7804 0.7804
0.7922 0.7922
0.7725 0.7725
0.7765 0.7765
(3,.,.) =
0.7686 0.7686
0.7529 0.7529
0.7529 0.7529
0.7569 0.7569
0.7451 0.7451
[torch.DoubleTensor of dimension 3x5x2] |
Yeah its definitely a problem of contiguity. When the input is contiguous, repeatTensor works. |
closed via c19c892 |
Thank you! |
Let's sat I have a column from an image which I'd like to replicate horizontally. Only the first two row are computed correctly.
The text was updated successfully, but these errors were encountered: