Skip to content
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

(cmake branch) Views cannot be reshaped #35

Open
wavepacket opened this issue Jun 5, 2023 · 0 comments
Open

(cmake branch) Views cannot be reshaped #35

wavepacket opened this issue Jun 5, 2023 · 0 comments

Comments

@wavepacket
Copy link

As the title suggests, it is not possible to directly reshape a tensor slice / view, that is,

CTensor x = CTensor::random(2, 3, 4);
CTensor y = reshape( x(_, 3, 4), 12);

fails to compile.
The workaround consists of assigning the slice to a new tensor, then reshaping this tensor. This workaround should not even carry significant performance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant