Repository navigation
Tags: hyperopt/hyperopt
Tags
fix: handle numpy.int64 scalar in switch node eval (fixes #949) numpy.int64 is not a subclass of Python int since numpy 1.20, so the bare isinstance(switch_i, int) check raises TypeError for hp.choice nodes when the sampled index is a numpy integer scalar. Add an explicit np.integer guard before the int check to coerce bare numpy integer scalars to Python int, matching the existing np.ndarray handling above it.
fix: handle numpy.int64 scalar in switch node eval (fixes #949) numpy.int64 is not a subclass of Python int since numpy 1.20, so the bare isinstance(switch_i, int) check raises TypeError for hp.choice nodes when the sampled index is a numpy integer scalar. Add an explicit np.integer guard before the int check to coerce bare numpy integer scalars to Python int, matching the existing np.ndarray handling above it.
PreviousNext