Skip to content

Commit

Permalink
Fix _linear_solve_forward()
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 10, 2025
1 parent ee24fcf commit 88f8050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def _linear_solve_forward(y: Tensor,
matrix_offset = reshaped_tensor(approx_matrix_vals, [batch_dims])
matrix_offset = math.where(solve.rank_deficiency > 0, matrix_offset, 0).native([batch_dims])
method = solve.method
if not callable(native_lin_op) and is_sparse(native_lin_op) and y.default_backend.name == 'torch' and preconditioner and not all_available(y):
if not callable(native_lin_op) and is_sparse(native_lin_op) and y_tensor.default_backend.name == 'torch' and preconditioner and not all_available(y):
warnings.warn(f"Preconditioners are not supported for sparse {method} in {y.default_backend} JIT mode. Disabling preconditioner. Use Jax or TensorFlow to enable preconditioners in JIT mode.", RuntimeWarning)
preconditioner = None
if not callable(native_lin_op) and is_sparse(native_lin_op) and not all_available(y) and not method.startswith('scipy-') and isinstance(preconditioner, IncompleteLU):
Expand Down

0 comments on commit 88f8050

Please sign in to comment.