Skip to content

Commit 9c0346e

Browse files
fix: apply review suggestions for loss validation
1 parent 940a73b commit 9c0346e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

pysr/sr.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ def _validate_elementwise_loss(custom_loss, *, has_weights: bool) -> None:
248248

249249
# This can be either a LossFunctions.jl object (e.g. `L2DistLoss()`) or a Julia function.
250250
# Only validate arity when the evaluated object is actually a function.
251-
if _jl_is_nothing(custom_loss):
252-
return
253-
254251
if not jl_is_function(custom_loss):
255252
return
256253

@@ -295,7 +292,7 @@ def _validate_custom_objective(
295292

296293
if not accepts_three_args and appears_elementwise:
297294
msg = (
298-
f"`{knob}` must have signature {signature}. "
295+
f"`{knob}` must have signature like {signature}. "
299296
f"If you intended an elementwise loss, use `{elementwise_alternative}`."
300297
)
301298
if other_alternative is not None:

0 commit comments

Comments
 (0)