From 5adf4768c727ff5da7251db23ac9fa7832be57f5 Mon Sep 17 00:00:00 2001 From: The tunix Authors Date: Fri, 27 Feb 2026 22:10:20 -0800 Subject: [PATCH] my public commit msg PiperOrigin-RevId: 876552023 --- tunix/rl/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tunix/rl/utils.py b/tunix/rl/utils.py index 6b54c62bc..b6599ec77 100644 --- a/tunix/rl/utils.py +++ b/tunix/rl/utils.py @@ -34,8 +34,11 @@ def is_positive_integer(value: int | None, name: str): """Checks if the value is positive.""" - if value is not None and (not value.is_integer() or value <= 0): - raise ValueError(f"{name} must be a positive integer. Got: {value}") + if value is not None: + if not isinstance(value, int): + raise ValueError(f"{name} must be an integer. Got type: {type(value)}") + if value <= 0: + raise ValueError(f"{name} must be a positive integer. Got: {value}") def check_divisibility(