Skip to content

Conversation

jimmieliu
Copy link

When value is a numpy array, comparing a numpy array with None object will give another numpy array. Then a ValueError will be raised, says: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). For example, you can test this funtion with value = numpy.array([1,2,3]), and default=None.

Thanks for your contribution!

If you're sending a large PR (e.g., >50 lines), please open an issue first about
the feature/bug, and indicate how you want to contribute.

Use contributing guidelines before opening up the PR to follow MMF style guidelines.

When value is a numpy array, comparing a numpy array with None object will give another numpy array. Then a ValueError will be raised, says: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
For example, you can test this funtion with value = numpy.array([1,2,3]), and default=None.
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants