File tree Expand file tree Collapse file tree 8 files changed +17
-10
lines changed Expand file tree Collapse file tree 8 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,13 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
127
127
if [ " ${CU_VERSION:- } " == cpu ] ; then
128
128
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu -U
129
129
else
130
- pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
130
+ pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
131
131
fi
132
132
elif [[ " $TORCH_VERSION " == " stable" ]]; then
133
133
if [ " ${CU_VERSION:- } " == cpu ] ; then
134
- pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
134
+ pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
135
135
else
136
- pip3 install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION
136
+ pip3 install torch torchvision --index-url https://download.pytorch.org/whl/$CU_VERSION -U
137
137
fi
138
138
else
139
139
printf " Failed to install pytorch"
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
34
34
fi
35
35
elif [[ " $TORCH_VERSION " == " stable" ]]; then
36
36
if [ " ${CU_VERSION:- } " == cpu ] ; then
37
- pip3 install torch --index-url https://download.pytorch.org/whl/cpu
37
+ pip3 install torch --index-url https://download.pytorch.org/whl/cpu -U
38
38
else
39
39
pip3 install torch --index-url https://download.pytorch.org/whl/cu121
40
40
fi
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
37
37
fi
38
38
elif [[ " $TORCH_VERSION " == " stable" ]]; then
39
39
if [ " ${CU_VERSION:- } " == cpu ] ; then
40
- pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
40
+ pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
41
41
else
42
- pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121
42
+ pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121 -U
43
43
fi
44
44
else
45
45
printf " Failed to install pytorch"
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ if [[ "$TORCH_VERSION" == "nightly" ]]; then
37
37
fi
38
38
elif [[ " $TORCH_VERSION " == " stable" ]]; then
39
39
if [ " ${CU_VERSION:- } " == cpu ] ; then
40
- pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
40
+ pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu -U
41
41
else
42
42
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121
43
43
fi
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
20
20
git submodule sync && git submodule update --init --recursive
21
21
22
22
printf " Installing PyTorch with %s\n" " ${CU_VERSION} "
23
- pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION
23
+ pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION -U
24
24
25
25
# install tensordict
26
26
if [[ " $RELEASE " == 0 ]]; then
Original file line number Diff line number Diff line change 146
146
_split_and_pad_sequence,
147
147
)
148
148
149
+ TORCH_VERSION = torch.__version__
149
150
150
151
# Capture all warnings
151
152
pytestmark = [
@@ -15644,6 +15645,7 @@ def __init__(self):
15644
15645
assert p.device == dest
15645
15646
15646
15647
15648
+ @pytest.mark.skipif(TORCH_VERSION < "2.5", reason="requires torch>=2.5")
15647
15649
def test_exploration_compile():
15648
15650
m = ProbabilisticTensorDictModule(
15649
15651
in_keys=["loc", "scale"],
Original file line number Diff line number Diff line change 12
12
import numpy as np
13
13
import torch
14
14
from torch import distributions as D , nn
15
- from torch .compiler import assume_constant_result
15
+
16
+ try :
17
+ from torch .compiler import assume_constant_result
18
+ except ImportError :
19
+ from torch ._dynamo import assume_constant_result
20
+
16
21
from torch .distributions import constraints
17
22
from torch .distributions .transforms import _InverseTransform
18
23
Original file line number Diff line number Diff line change 26
26
27
27
try :
28
28
from torch .compiler import is_dynamo_compiling
29
- except ImportError :
29
+ except ModuleNotFoundError :
30
30
from torch ._dynamo import is_compiling as is_dynamo_compiling
31
31
32
32
You can’t perform that action at this time.
0 commit comments