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

slicing returns error if tt_vector has only 1 core #67

Open
aiboyko opened this issue Aug 14, 2018 · 1 comment
Open

slicing returns error if tt_vector has only 1 core #67

aiboyko opened this issue Aug 14, 2018 · 1 comment

Comments

@aiboyko
Copy link
Contributor

aiboyko commented Aug 14, 2018

@Bihaqo

@Bihaqo
Copy link
Contributor

Bihaqo commented Aug 15, 2018

Please change this line: https://github.com/oseledets/ttpy/blob/master/tt/core/vector.py#L189 from
answ_cores[-1] = _np.dot(answ_cores[-1], running_fact)
to

if len(answ_cores) > 0:
  answ_cores[-1] = _np.dot(answ_cores[-1], running_fact)
else:
  # Result is a number.
  answ_cores = [reshape(running_fact, (1, 1, 1))]

And add a test for this behavior.

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

No branches or pull requests

2 participants