File tree Expand file tree Collapse file tree 8 files changed +9
-182
lines changed Expand file tree Collapse file tree 8 files changed +9
-182
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ __pycache__/
14
14
.installed.cfg
15
15
MANIFEST
16
16
build /
17
- data /
17
+ . / data /
18
18
develop-eggs /
19
19
dist /
20
20
downloads /
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
import sys
12
12
import time
13
13
import unittest
14
- import warnings
15
14
from functools import wraps
16
15
from typing import Callable
17
16
24
23
25
24
from torchrl ._utils import (
26
25
implement_for ,
26
+ logger ,
27
27
logger as torchrl_logger ,
28
28
RL_WARNINGS ,
29
29
seed_generator ,
@@ -792,7 +792,7 @@ def _call_value_nets(
792
792
)
793
793
else :
794
794
if RL_WARNINGS :
795
- warnings . warn (
795
+ logger . warning (
796
796
"Got a tensordict without a time-marked dimension, assuming time is along the last dimension. "
797
797
"This warning can be turned off by setting the environment variable RL_WARNINGS to False."
798
798
)
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def _is_nightly(version):
48
48
" - make sure ninja and cmake were installed\n "
49
49
" - make sure you ran `python setup.py clean && python setup.py develop` and that no error was raised\n "
50
50
" - make sure the version of PyTorch you are using matches the one that was present in your virtual env during "
51
- f"setup. This package was built with PyTorch { pytorch_version } ."
51
+ f"setup. This package was built with PyTorch { pytorch_version } . You can deactivate this warning by setting the environment variable `RL_WARNINGS=0`. "
52
52
)
53
53
54
54
else :
@@ -59,5 +59,6 @@ def _is_nightly(version):
59
59
"prioritized replay buffers can only be used with the PyTorch version they were built against. "
60
60
f"This package was built with PyTorch { pytorch_version } . "
61
61
"Workarounds include: (1) upgrading/downgrading PyTorch or TorchRL to compatible versions, "
62
- "or (2) making a local install using `pip install git+https://github.com/pytorch/rl.git@<version>`."
62
+ "or (2) making a local install using `pip install git+https://github.com/pytorch/rl.git@<version>`. "
63
+ "You can deactivate this warning by setting the environment variable `RL_WARNINGS=0`."
63
64
)
Original file line number Diff line number Diff line change 18
18
import torch
19
19
from tensordict import MemoryMappedTensor , TensorDict
20
20
from tensordict .utils import NestedKey
21
-
22
21
from torch .utils ._pytree import tree_map
23
22
from torchrl ._extension import EXTENSION_WARNING
24
23
from torchrl ._utils import _replace_last , logger
33
32
SumSegmentTreeFp64 ,
34
33
)
35
34
except ImportError :
36
- warnings . warn (EXTENSION_WARNING )
35
+ logger . warning (EXTENSION_WARNING )
37
36
38
37
_EMPTY_STORAGE_ERROR = "Cannot sample from an empty storage."
39
38
Original file line number Diff line number Diff line change 27
27
from tensordict .utils import NestedKey , unravel_key
28
28
from torch import Tensor
29
29
30
- from torchrl ._utils import RL_WARNINGS
30
+ from torchrl ._utils import logger , RL_WARNINGS
31
31
from torchrl .envs .utils import step_mdp
32
32
from torchrl .objectives .utils import (
33
33
_maybe_get_or_select ,
@@ -452,7 +452,7 @@ def _call_value_nets(
452
452
ndim = list (data .names ).index ("time" ) + 1
453
453
except ValueError :
454
454
if RL_WARNINGS :
455
- warnings . warn (
455
+ logger . warning (
456
456
"Got a tensordict without a time-marked dimension, assuming time is along the last dimension. "
457
457
"This warning can be turned off by setting the environment variable RL_WARNINGS to False."
458
458
)
You can’t perform that action at this time.
0 commit comments