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

ktensor.normalize error when sorting #96

Closed
dmdunla opened this issue Apr 25, 2023 · 0 comments · Fixed by #103
Closed

ktensor.normalize error when sorting #96

dmdunla opened this issue Apr 25, 2023 · 0 comments · Fixed by #103
Labels
bug Something isn't working doing Actively being worked on

Comments

@dmdunla
Copy link
Collaborator

dmdunla commented Apr 25, 2023

There is a bug in the following code in ktensor.normalize():

if sort:
            if self.ncomponents > 1:
                # indices of srting in descending order
                p = np.argsort(self.weights)[::-1]
                self = self.arrange(permutation=p)

ktensor.arrange does not return a ktensor. When ktensor.normalize(sort=True) is called, None is returned due to the last line. The code self = should be removed in the last line above.

The documentation for arrange should change as well to reflect this, as ktensor.arrange documentation states that it returns a pyttb.ktensor.

@dmdunla dmdunla added doing Actively being worked on bug Something isn't working labels Apr 29, 2023
@dmdunla dmdunla linked a pull request Apr 29, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working doing Actively being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant