Skip to content

Commit

Permalink
select op support in torchxla2 (#7293)
Browse files Browse the repository at this point in the history
  • Loading branch information
miladm authored Jun 17, 2024
1 parent 61c794d commit f50e951
Show file tree
Hide file tree
Showing 2 changed files with 3 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 @@ -290,7 +290,6 @@
"scatter",
"scatter_reduce",
"searchsorted",
"select",
"select_scatter",
"signbit",
"softmax",
Expand Down
3 changes: 3 additions & 0 deletions experimental/torch_xla2/torch_xla2/ops/jaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def _aten_index_copy(x, dim, indexes, source):


@op(torch.ops.aten.select)
def _aten_select(x, dim, indexes):
return jax.lax.index_in_dim(x, index=indexes, axis=dim, keepdims=False)

@op(torch.ops.aten.index_select)
@op(torch.ops.aten.select_copy)
def _aten_index_select(x, dim, indexes):
Expand Down

0 comments on commit f50e951

Please sign in to comment.