Skip to content

Explicitly make out a jax.Array before converting it in lax_numpy.array. #28966

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented May 23, 2025

Explicitly make out a jax.Array before converting it in lax_numpy.array.

This allows avoiding an unnecessary copy in
lax_internal._convert_element_type when the original dtype is the same as
the output dtype (the fast path does an instance check, which fails on
np.ndarrays).

@copybara-service copybara-service bot force-pushed the test_762322412 branch 4 times, most recently from 6d1bad3 to 611a0fe Compare May 23, 2025 09:41
…y.array`.

This allows avoiding an unnecessary copy in
`lax_internal._convert_element_type` when the original `dtype` is the same as
the output `dtype` (the fast path does an instance check, which fails on
`np.ndarray`s).

PiperOrigin-RevId: 762322412
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.

1 participant