Skip to content

Commit 63ef4fd

Browse files
author
Vincent Moens
committed
Versioning
1 parent ee585a3 commit 63ef4fd

File tree

7 files changed

+15
-22
lines changed

7 files changed

+15
-22
lines changed

.github/scripts/version_script.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set TENSORDICT_BUILD_VERSION=0.7.1
2+
set TENSORDICT_BUILD_VERSION=0.7.2
33
echo TENSORDICT_BUILD_VERSION is set to %TENSORDICT_BUILD_VERSION%
44

55
@echo on

.github/scripts/version_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
export TENSORDICT_BUILD_VERSION=0.7.1
3+
export TENSORDICT_BUILD_VERSION=0.7.2

tensordict/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
lazy_legacy,
9797
lock_blocked,
9898
prod,
99-
set_capture_non_tensor_stack,
10099
set_lazy_legacy,
101100
strtobool,
102101
TensorDictFuture,
@@ -9103,8 +9102,7 @@ def newfn(item_and_out):
91039102
from tensordict._lazy import LazyStackedTensorDict
91049103

91059104
# We want to be able to return whichever data structure
9106-
with set_capture_non_tensor_stack(False):
9107-
out = LazyStackedTensorDict.maybe_dense_stack(imaplist, dim)
9105+
out = LazyStackedTensorDict.maybe_dense_stack(imaplist, dim)
91089106
else:
91099107
out = torch.cat(imaplist, dim)
91109108
return out

tensordict/tensorclass.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,9 +3219,7 @@ def _stack_non_tensor(cls, list_of_non_tensor, dim=0, raise_if_non_unique=False)
32193219

32203220
ids = set()
32213221
firstdata = NO_DEFAULT
3222-
return_stack = not capture_non_tensor_stack()
3223-
if return_stack:
3224-
return NonTensorStack(*list_of_non_tensor, stack_dim=dim)
3222+
return_stack = False
32253223
for data in list_of_non_tensor:
32263224
if not isinstance(data, NonTensorData):
32273225
if raise_if_non_unique:

test/test_tensorclass.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,18 +1258,16 @@ def test_pickle(self):
12581258

12591259
@pytest.mark.parametrize("consolidate", [False, True])
12601260
def test_pickle_consolidate(self, consolidate):
1261-
with set_capture_non_tensor_stack(False):
1262-
1263-
tc = TCStrings(a="a", b="b")
1264-
1265-
tcstack = TensorDict(tc=torch.stack([tc, tc.clone()]))
1266-
if consolidate:
1267-
tcstack = tcstack.consolidate()
1268-
assert isinstance(tcstack["tc"], TCStrings)
1269-
loaded = pickle.loads(pickle.dumps(tcstack))
1270-
assert isinstance(loaded["tc"], TCStrings)
1271-
assert loaded["tc"].a == tcstack["tc"].a
1272-
assert loaded["tc"].b == tcstack["tc"].b
1261+
tc = TCStrings(a="a", b="b")
1262+
1263+
tcstack = TensorDict(tc=torch.stack([tc, tc.clone()]))
1264+
if consolidate:
1265+
tcstack = tcstack.consolidate()
1266+
assert isinstance(tcstack["tc"], TCStrings)
1267+
loaded = pickle.loads(pickle.dumps(tcstack))
1268+
assert isinstance(loaded["tc"], TCStrings)
1269+
assert loaded["tc"].a == tcstack["tc"].a
1270+
assert loaded["tc"].b == tcstack["tc"].b
12731271

12741272
def test_post_init(self):
12751273
@tensorclass

test/test_tensordict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11210,7 +11210,6 @@ def non_tensor_data(self):
1121011210
batch_size=[],
1121111211
)
1121211212

11213-
@set_capture_non_tensor_stack(False)
1121411213
def test_consolidate_nested(self):
1121511214
import pickle
1121611215

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.1
1+
0.7.2

0 commit comments

Comments
 (0)