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

Fix logic for determining if a value can be cast to a specific dtype. #4583

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

Fix logic for determining if a value can be cast to a specific dtype.

Note:

  • np.can_cast does not operate on non-scalar arrays.
  • np.can_cast interprets strings as dtype like specifications.

Therefore, it's required to handle these cases differently.

Additionally:

  1. Moved the logic for determining if a array is compatible with a dtype or a shape to array.py.
  2. Fixed a lint error in building_blocks module.

Note:

* `np.can_cast` does not operate on non-scalar arrays.
* `np.can_cast` interprets strings as dtype like specifications.

Therefore, it's required to handle these cases differently.

Additionally:

1. Moved the logic for determining if a array is compatible with a dtype or a shape to `array.py`.
2. Fixed a lint error in `building_blocks` module.

PiperOrigin-RevId: 619218713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant