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

reshape() not in tensor namespace (cmake-branch) #32

Open
wavepacket opened this issue May 19, 2023 · 1 comment
Open

reshape() not in tensor namespace (cmake-branch) #32

wavepacket opened this issue May 19, 2023 · 1 comment

Comments

@wavepacket
Copy link

I just noted a smaller issue in the CMake branch of the tensor library.

The function reshape(Tensor<>, Dimension) is defined inside the Tensor class with an inline friend definition. According to the C++ specification, such a construct creates a free function that is a friend of the Tensor class. At least g++ creates this friend function outside of the tensor namespace; I have not checked the small print if this is standard behavior or a defect, but it is definitely an issue.

In principle, this should rarely be a problem: Most people should be "using namespace tensor" . However, it is surprising behavior that tensor::reshape() does not resolve to an existing function anymore.

@wavepacket
Copy link
Author

The same issue also affects the function flatten().

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