How to transpose a tensor and have the transpose reflected in contiguous memory with CUDA backend #684
Answered
by
balisujohn
balisujohn
asked this question in
Q&A
-
I have a contiguous tensor of shape
I want to transpose this tensor and have the transpose reflected in contiguous memory. So I try the code:
and I get the same results when printing out the first and last 3 values from memory:
How can I get a transpose that's actually reflected in contiguous memory for the first 2 dimensions of a 4d tensor? I should add that this is with a cuda backend, and |
Beta Was this translation helpful? Give feedback.
Answered by
balisujohn
Jan 7, 2024
Replies: 1 comment 2 replies
-
This strategy seems to work actually:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
balisujohn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This strategy seems to work actually: