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

Cleanup: remove extraneous device_put #4530

Merged
merged 1 commit into from Oct 13, 2020
Merged

Conversation

@jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Oct 9, 2020

Minor issue, but I spent a while trying to understand why this line was here before realizing it was unnecessary.

Quick spot check, using this code:

from jax import config, jit, lax, partial, make_jaxpr
config.disable_omnistaging()
f = partial(lax.full, ())
print(make_jaxpr(f)(0))
print(repr(f(0)))
print(repr(jit(f)(0)))

Result on master:

{ lambda  ; a.
  let b = device_put a
  in (b,) }
DeviceArray(0, dtype=int32)
DeviceArray(0, dtype=int32)

Result on this branch:

{ lambda  ; a.
  let 
  in (a,) }
DeviceArray(0, dtype=int32)
DeviceArray(0, dtype=int32)

The key observation is that device arrays are being returned, despite the lack of an explicit device_put on this branch.

@google-cla google-cla bot added the cla: yes label Oct 9, 2020
@jakevdp jakevdp requested a review from mattjj Oct 9, 2020
mattjj
mattjj approved these changes Oct 12, 2020
Copy link
Member

@mattjj mattjj left a comment

LGTM!

@copybara-service copybara-service bot merged commit 5981fc3 into google:master Oct 13, 2020
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants