116
116
_has_gym = importlib .util .find_spec ("gym" ) is not None
117
117
_has_snapshot = importlib .util .find_spec ("torchsnapshot" ) is not None
118
118
_os_is_windows = sys .platform == "win32"
119
+ TORCH_VERSION = version .parse (version .parse (torch .__version__ ).base_version )
119
120
120
121
torch_2_3 = version .parse (
121
122
"." .join ([str (s ) for s in version .parse (str (torch .__version__ )).release ])
@@ -404,14 +405,16 @@ def data_iter():
404
405
) if cond else contextlib .nullcontext ():
405
406
rb .extend (data2 )
406
407
408
+ @pytest .mark .skipif (
409
+ TORCH_VERSION < version .parse ("2.5.0" ), reason = "requires Torch >= 2.5.0"
410
+ )
411
+ # Compiling on Windows requires "cl" compiler to be installed.
412
+ # <https://github.com/pytorch/pytorch/blob/8231180147a096a703d8891756068c89365292e0/torch/_inductor/cpp_builder.py#L143>
413
+ # Our Windows CI jobs do not have "cl", so skip this test.
414
+ @pytest .mark .skipif (_os_is_windows , reason = "windows tests do not support compile" )
407
415
def test_extend_sample_recompile (
408
416
self , rb_type , sampler , writer , storage , size , datatype
409
417
):
410
- if _os_is_windows :
411
- # Compiling on Windows requires "cl" compiler to be installed.
412
- # <https://github.com/pytorch/pytorch/blob/8231180147a096a703d8891756068c89365292e0/torch/_inductor/cpp_builder.py#L143>
413
- # Our Windows CI jobs do not have "cl", so skip this test.
414
- pytest .skip ("This test does not support Windows." )
415
418
if rb_type is not ReplayBuffer :
416
419
pytest .skip (
417
420
"Only replay buffer of type 'ReplayBuffer' is currently supported."
@@ -429,7 +432,7 @@ def test_extend_sample_recompile(
429
432
if datatype == "tensordict" :
430
433
pytest .skip ("'tensordict' datatype is not currently supported." )
431
434
432
- torch ._dynamo .reset ()
435
+ torch ._dynamo .reset_code_caches ()
433
436
434
437
storage_size = 10 * size
435
438
rb = self ._get_rb (
0 commit comments