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 places that were passing jnp.array where a shape was expected. #1595

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions trax/models/research/transformer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ def _UpdateRow(x):
# In `row_ed` start where encoder tokens/vecs end, i.e. are index `len_e`
# and pick up (L2, H) tensor slice from there.
zero = jnp.array(0, dtype=len_e.dtype) # avoid int32/int64 mismatch
l2_np = jnp.array(L2, dtype=len_e.dtype)
h_np = jnp.array(H, dtype=len_e.dtype)
return fastmath.dynamic_slice(row_ed, (len_e, zero), (l2_np, h_np))
return fastmath.dynamic_slice(row_ed, (len_e, zero), (L2, H))

return fastmath.map(_UpdateRow, [vec_ed, tok_e, tok_d])

Expand Down