Skip to content

Conversation

herman159
Copy link
Contributor

Detailed description:

  • Directly use the single element as the score if the similarity array has only one item, instead of attempting to extract a diagonal.
  • Added a condition to check similarity.size to determine whether diagonal extraction is necessary.
  • Updated unit tests to reflect this change.

Fixes #474

…lodinggradients#474

Detailed description:
- Directly use the single element as the score if the similarity array has only one item, instead of attempting to extract a diagonal.
- Added a condition to check similarity.size to determine whether diagonal extraction is necessary.
- Updated unit tests to reflect this change.

Fixes explodinggradients#474
Copy link
Member

@shahules786 shahules786 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 @herman159 , can you also do the same for _score function?

@shahules786 shahules786 self-requested a review January 20, 2024 19:28
@shahules786 shahules786 merged commit 04fdb30 into explodinggradients:main Jan 20, 2024
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.

ValueError: diag requires an array of at least two dimensions

2 participants