Closed
Description
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
.