Skip to content

Conversation

@Witiko
Copy link
Contributor

@Witiko Witiko commented Mar 16, 2019

Contrary to the documentation, matutils.unitvec(…, return_norm=True) function does not always return a float norm:

  1. Zero vectors stored as numpy arrays will return an integer norm.
  2. Zero vectors stored as lists of tuples (the Gensim BOW format) will return no norm.

This PR applies minimum changes to fix these two issues.

Copy link
Owner

@piskvorky piskvorky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks for the tests.

@Witiko Witiko changed the title Make matutils.unitvec always return norm when requested Make matutils.unitvec always return float norm when requested Mar 18, 2019
@mpenkov mpenkov merged commit 3514d3f into piskvorky:develop Apr 20, 2019
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

Successfully merging this pull request may close these issues.

3 participants