Skip to content

Commit f33ae97

Browse files
committed
feat(rune): Implement qr operation
1 parent 82d0daa commit f33ae97

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

rune/lib/nx_rune.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,16 @@ let op_irfft (type a c) (t : (Complex.t, a) t) ~(dtype : (float, c) Dtype.t)
611611
let op_cholesky ~upper:_ _ =
612612
failwith "op_cholesky: not implemented in Rune backend"
613613

614-
let op_qr ~reduced:_ _ = failwith "op_qr: not implemented in Rune backend"
614+
let op_qr ~reduced t_in =
615+
try
616+
(* No effect for qr currently; perform directly on native tensors. *)
617+
match t_in with
618+
| Native_tensor t ->
619+
let q, r = Nx_c.op_qr ~reduced t in
620+
(Native_tensor q, Native_tensor r)
621+
| Symbolic_tensor _ -> failwith "op_qr: symbolic tensors not supported in Rune backend"
622+
with Effect.Unhandled _ -> failwith "op_qr: not implemented in Rune backend"
623+
615624

616625
let op_svd ~full_matrices:_ _ =
617626
failwith "op_svd: not implemented in Rune backend"

0 commit comments

Comments
 (0)