Suppose that tensor A is defined as:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
I'm trying to extract a flat array out of this matrix by using another tensor as indices. For example, if the second tensor is defined as:
0
1
2
3
I want the result of the indexing to be 1-D tensor with the contents:
1
6
11
16
It doesn't seem to behave like NumPy; I've tried A[:, B] but it just throws an error for not being able to allocate an insane amount of memory and I've no idea why!