Skip to content

Commit

Permalink
[torch_xla2] Fix cholesky_inverse (#8214)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvhg authored Oct 4, 2024
1 parent 922805e commit eba28f1
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -21,7 +21,6 @@
"cdist",
"ceil",
"cholesky",
"cholesky_inverse",
"cholesky_solve",
"complex",
"diagonal_copy",
Expand Down
8 changes: 8 additions & 0 deletions experimental/torch_xla2/torch_xla2/ops/jaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,14 @@ def _aten__pdist_forward(x, p=2):
return condensed_dists


@op(torch.ops.aten.cholesky_inverse)
def _aten_cholesky_inverse(input, upper=False):
t = jnp.matrix_transpose(input)
if "complex" in str(input.dtype):
t = t.conjugate()
return jnp.linalg.inv(input @ t)


# aten.cos
@op(torch.ops.aten.cos)
@op_base.promote_int_input
Expand Down

0 comments on commit eba28f1

Please sign in to comment.