mnick / scikit-tensor

Python library for multilinear algebra and tensor factorizations
GNU General Public License v3.0
401 stars 113 forks source link

Sptensor wrong check. #37

Open gaurush-hiranandani opened 6 years ago

gaurush-hiranandani commented 6 years ago

In line 71 of sptensor.py, I believe the condition to check should be len(subs) == len(vals). The reason is that we want to check the number of provided subscripts to be equal to the number of values. Currently, it is checking the dimension of the tensor to be equal to the number of values which probably isn't right. Although, it works in the provided example because the dimension, the subscripts, and the values are all three. Correct me, if I am wrong.