lava-optimization
lava-optimization copied to clipboard
ReadGate PyModel not working with target_cost=None
Describe the bug The ReadGate doesn't work with timeout=None when running on CPU.
To reproduce current behavior Steps to reproduce the behavior:
- When I run this code (add code or minimum test case) ...
from lava.lib.optimization.problems.problems import QUBO
from lava.lib.optimization.solvers.generic.solver import OptimizationSolver
import numpy as np
Q = np.array([[11, -5, 2, 0, -6],
[-5, -13, -1, -3, 10],
[2, -1, 0, 2, 10],
[0, -3, 2, 2, -1],
[-6, 10, 10, -1, -3]])
problem = QUBO(Q)
solver = OptimizationSolver(problem)
solution = solver.solve(timeout=50,
target_cost=None
)
- I get this error ...
TypeError: '<=' not supported between instances of 'int' and 'NoneType'
Expected behavior The OptimizationSolver should run until the timeout is reached.
Environment (please complete the following information):
- Device: Intel cloud
- OS: Linux
- Lava version 0.6.1