Skip to content

Commit fff3e79

Browse files
committed
Update
[ghstack-poisoned]
1 parent 08cb766 commit fff3e79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/test_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
import torch
1616

1717
from _utils_internal import capture_log_records, get_default_devices
18+
from packaging import version
1819
from torchrl._utils import _rng_decorator, get_binary_env_var, implement_for
1920

2021
from torchrl.envs.libs.gym import gym_backend, GymWrapper, set_gym_backend
2122

23+
TORCH_VERSION = version.parse(version.parse(torch.__version__).base_version)
24+
2225

2326
@pytest.mark.parametrize("value", ["True", "1", "true"])
2427
def test_get_binary_env_var_positive(value):
@@ -382,6 +385,9 @@ def test_rng_decorator(device):
382385

383386
# Check that 'capture_log_records' captures records emitted when torch
384387
# recompiles a function.
388+
@pytest.mark.skipif(
389+
TORCH_VERSION < version.parse("2.5.0"), reason="requires Torch >= 2.5.0"
390+
)
385391
def test_capture_log_records_recompile():
386392
torch.compiler.reset()
387393

0 commit comments

Comments
 (0)