Skip to content

Commit

Permalink
[Test] Fix as_tensor test (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored Nov 2, 2023
1 parent 09b327c commit 9865dec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ printf "* Installing tensordict\n"
python setup.py develop

# install torchsnapshot nightly
python -m pip install git+https://github.com/pytorch/torchsnapshot --no-build-isolation

if [[ "$TORCH_VERSION" == "nightly" ]]; then
python -m pip install git+https://github.com/pytorch/torchsnapshot --no-build-isolation
elif [[ "$TORCH_VERSION" == "stable" ]]; then
python -m pip install torchsnapshot
fi
# smoke test
python -c "import functorch;import torchsnapshot"
4 changes: 2 additions & 2 deletions test/test_tensordict.py
Original file line number Diff line number Diff line change
Expand Up @@ -2283,8 +2283,8 @@ def test_as_tensor(self, td_name, device):
):
td.as_tensor()
else:
with pytest.raises(AttributeError):
td.as_tensor()
# checks that it runs
td.as_tensor()

def test_items_values_keys(self, td_name, device):
torch.manual_seed(1)
Expand Down

0 comments on commit 9865dec

Please sign in to comment.