Skip to content

Commit

Permalink
Fix outer result dtype (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite authored Sep 24, 2024
1 parent c1391c0 commit 73bbf5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cubed/array_api/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from cubed.array_api.array_object import Array

# These functions are in both the main and linalg namespaces
from cubed.array_api.data_type_functions import result_type
from cubed.array_api.linear_algebra_functions import ( # noqa: F401
matmul,
matrix_transpose,
Expand All @@ -15,7 +16,9 @@


def outer(x1, x2, /):
return blockwise(nxp.linalg.outer, "ij", x1, "i", x2, "j", dtype=x1.dtype)
return blockwise(
nxp.linalg.outer, "ij", x1, "i", x2, "j", dtype=result_type(x1, x2)
)


class QRResult(NamedTuple):
Expand Down

0 comments on commit 73bbf5c

Please sign in to comment.