Skip to content

Commit fa697fe

Browse files
author
Vincent Moens
committed
[Deprecation] Gracing old *Spec with v0.8 versioning
ghstack-source-id: e7c6e0a Pull Request resolved: #2751
1 parent 0feef11 commit fa697fe

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

test/test_specs.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,7 @@ class TestLegacy:
39553955
def test_one_hot(self):
39563956
with pytest.warns(
39573957
DeprecationWarning,
3958-
match="The OneHotDiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use OneHot instead.",
3958+
match="The OneHotDiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use OneHot instead.",
39593959
):
39603960
one_hot = OneHotDiscreteTensorSpec(n=4)
39613961
assert isinstance(one_hot, OneHotDiscreteTensorSpec)
@@ -3969,7 +3969,7 @@ def test_one_hot(self):
39693969
def test_discrete(self):
39703970
with pytest.warns(
39713971
DeprecationWarning,
3972-
match="The DiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use Categorical instead.",
3972+
match="The DiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use Categorical instead.",
39733973
):
39743974
discrete = DiscreteTensorSpec(n=4)
39753975
assert isinstance(discrete, DiscreteTensorSpec)
@@ -3996,7 +3996,7 @@ def test_unbounded(self):
39963996

39973997
with pytest.warns(
39983998
DeprecationWarning,
3999-
match="The UnboundedContinuousTensorSpec has been deprecated and will be removed in v0.7. Please use Unbounded instead.",
3999+
match="The UnboundedContinuousTensorSpec has been deprecated and will be removed in v0.8. Please use Unbounded instead.",
40004000
):
40014001
unbounded_continuous = UnboundedContinuousTensorSpec()
40024002
assert isinstance(unbounded_continuous, Unbounded)
@@ -4009,7 +4009,7 @@ def test_unbounded(self):
40094009

40104010
with pytest.warns(
40114011
DeprecationWarning,
4012-
match="The UnboundedDiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use Unbounded instead.",
4012+
match="The UnboundedDiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use Unbounded instead.",
40134013
):
40144014
unbounded_discrete = UnboundedDiscreteTensorSpec()
40154015
assert isinstance(unbounded_discrete, Unbounded)
@@ -4040,7 +4040,7 @@ def test_unbounded(self):
40404040
def test_multi_one_hot(self):
40414041
with pytest.warns(
40424042
DeprecationWarning,
4043-
match="The MultiOneHotDiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use MultiOneHot instead.",
4043+
match="The MultiOneHotDiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use MultiOneHot instead.",
40444044
):
40454045
one_hot = MultiOneHotDiscreteTensorSpec(nvec=[4, 3])
40464046
assert isinstance(one_hot, MultiOneHotDiscreteTensorSpec)
@@ -4054,7 +4054,7 @@ def test_multi_one_hot(self):
40544054
def test_multi_categorical(self):
40554055
with pytest.warns(
40564056
DeprecationWarning,
4057-
match="The MultiDiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use MultiCategorical instead.",
4057+
match="The MultiDiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use MultiCategorical instead.",
40584058
):
40594059
categorical = MultiDiscreteTensorSpec(nvec=[4, 3])
40604060
assert isinstance(categorical, MultiDiscreteTensorSpec)
@@ -4068,7 +4068,7 @@ def test_multi_categorical(self):
40684068
def test_binary(self):
40694069
with pytest.warns(
40704070
DeprecationWarning,
4071-
match="The BinaryDiscreteTensorSpec has been deprecated and will be removed in v0.7. Please use Binary instead.",
4071+
match="The BinaryDiscreteTensorSpec has been deprecated and will be removed in v0.8. Please use Binary instead.",
40724072
):
40734073
binary = BinaryDiscreteTensorSpec(5)
40744074
assert isinstance(binary, BinaryDiscreteTensorSpec)
@@ -4082,7 +4082,7 @@ def test_binary(self):
40824082
def test_bounded(self):
40834083
with pytest.warns(
40844084
DeprecationWarning,
4085-
match="The BoundedTensorSpec has been deprecated and will be removed in v0.7. Please use Bounded instead.",
4085+
match="The BoundedTensorSpec has been deprecated and will be removed in v0.8. Please use Bounded instead.",
40864086
):
40874087
bounded = BoundedTensorSpec(-2, 2, shape=())
40884088
assert isinstance(bounded, BoundedTensorSpec)
@@ -4097,7 +4097,7 @@ def test_composite(self):
40974097
with (
40984098
pytest.warns(
40994099
DeprecationWarning,
4100-
match="The CompositeSpec has been deprecated and will be removed in v0.7. Please use Composite instead.",
4100+
match="The CompositeSpec has been deprecated and will be removed in v0.8. Please use Composite instead.",
41014101
)
41024102
):
41034103
composite = CompositeSpec()
@@ -4113,7 +4113,7 @@ def test_non_tensor(self):
41134113
with (
41144114
pytest.warns(
41154115
DeprecationWarning,
4116-
match="The NonTensorSpec has been deprecated and will be removed in v0.7. Please use NonTensor instead.",
4116+
match="The NonTensorSpec has been deprecated and will be removed in v0.8. Please use NonTensor instead.",
41174117
)
41184118
):
41194119
non_tensor = NonTensorSpec()

torchrl/data/tensor_specs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6118,7 +6118,7 @@ def _remove_neg_shapes(*shape):
61186118
class _LegacySpecMeta(abc.ABCMeta):
61196119
def __call__(cls, *args, **kwargs):
61206120
warnings.warn(
6121-
f"The {cls.__name__} has been deprecated and will be removed in v0.7. Please use "
6121+
f"The {cls.__name__} has been deprecated and will be removed in v0.8. Please use "
61226122
f"{cls.__bases__[-1].__name__} instead.",
61236123
category=DeprecationWarning,
61246124
)

0 commit comments

Comments
 (0)