Skip to content

Commit

Permalink
Convert x0 in solve_linear()
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 1, 2024
1 parent 4eac42b commit 3751f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion phiml/math/_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ def solve_linear(f: Union[Callable[[X], Y], Tensor],

if isinstance(f, Tensor) or (isinstance(f, LinearFunction) and prefer_explicit): # Matrix solve
if isinstance(f, LinearFunction):
matrix, bias = f.sparse_matrix_and_bias(solve.x0, *f_args, **f_kwargs)
x0 = math.convert(solve.x0)
matrix, bias = f.sparse_matrix_and_bias(x0, *f_args, **f_kwargs)
else:
matrix = f
bias = 0
Expand Down

0 comments on commit 3751f17

Please sign in to comment.