Skip to content

Commit

Permalink
Add support for torch.unravel_index. (#8266)
Browse files Browse the repository at this point in the history
Co-authored-by: mrguenther <[email protected]>
  • Loading branch information
mrguenther and mrguenther authored Oct 18, 2024
1 parent d1a1966 commit a3e4e12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion experimental/torch_xla2/test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"svd_lowrank",
"unfold_copy",
"unfold",
"unravel_index",
"nanmean",
"nn.functional.upsample_bilinear",
"randint",
Expand Down
5 changes: 5 additions & 0 deletions experimental/torch_xla2/torch_xla2/ops/jtorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ def empty_strided(
return empty(size, dtype=dtype)


@register_function(torch.unravel_index)
def unravel_index(indices, shape):
return jnp.unravel_index(indices, shape)


@register_function(torch.rand, is_jax_function=False)
def rand(
*size, **kwargs
Expand Down

0 comments on commit a3e4e12

Please sign in to comment.