Last active
August 24, 2018 07:54
-
-
Save wanchaol/e45386221e1226791a34d5734856b7a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input = torch.randn(2,2) | |
part = torch.tensor([[1, 2]]) | |
ind0 = torch.arange(0,1) | |
ind1 = torch.arange(0,2) | |
input = torch.index_put(input, (ind0, ind1), part) | |
--------------------------------------------------------------------------- | |
RuntimeError Traceback (most recent call last) | |
<ipython-input-39-8e225bbb2c1f> in <module>() | |
6 ind1 = torch.arange(0,2) | |
7 | |
----> 8 input = torch.index_put(input, (ind0, ind1), part) | |
RuntimeError: expand(torch.LongTensor{[1, 2]}, size=[2]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment