Skip to content

ktensor.normalize error when sorting #96

Closed
@dmdunla

Description

@dmdunla

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdoingActively being worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions