Skip to content

Fixing inefficiency in pyttb.tenrand. #428

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

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

tgkolda
Copy link
Collaborator

@tgkolda tgkolda commented Apr 5, 2025

The old version was creating random data as a multiway array, reordering it to Fortran order (expensive and unnecessary), and then called the tensor constructor. Instead, we exploit the fact that we can just pass a 1D random array and then reshape that into the desired shape. While the reordering makes little difference for small tensors, it can get quite expensive at scale.


📚 Documentation preview 📚: https://pyttb--428.org.readthedocs.build/en/428/

tgkolda and others added 2 commits April 4, 2025 17:07
The old version was creating random data as a multway arraw, reordering it to Fortran order (expensive and pointless), and then called the tensor constructor. Instead, we exploit the fact that we can just pass a 1D random array and then reshape that into the desired shape.
@dmdunla dmdunla merged commit d7bb85a into sandialabs:main Apr 8, 2025
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants