Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
fail-fast: false
matrix:
ml-deps:
- "torch==1.9.1+cpu tensorflow-cpu==2.5.3"
- "torch==1.10.2+cpu tensorflow-cpu==2.6.3"
- "torch==1.11.0+cpu tensorflow-cpu==2.7.1"
- "torch==1.12.0+cpu tensorflow-cpu==2.8.1"

env:
run_coverage: ${{ github.ref == 'refs/heads/master' }}
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import setuptools

tensorflow = ["tensorflow>=2.5"]
pytorch = ["torch>=1.9"]
tensorflow = ["tensorflow>=2.6"]
pytorch = ["torch>=1.10"]
sklearn = ["scikit-learn>=1.0"]
cloud = ["tiledb-cloud"]
full = sorted({"torchvision", *tensorflow, *pytorch, *sklearn, *cloud})
Expand Down
9 changes: 1 addition & 8 deletions tiledb/ml/readers/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
import torch
from torch.utils.data import DataLoader, IterableDataset, get_worker_info

try:
# torch>=1.10
sparse_csr_tensor = torch.sparse_csr_tensor
except AttributeError:
# torch=1.9
sparse_csr_tensor = torch._sparse_csr_tensor

import tiledb

from ._tensor_schema import DenseTensorSchema, SparseTensorSchema, TensorSchema
Expand Down Expand Up @@ -157,7 +150,7 @@ def _csr_to_coo_collate(arrays: Sequence[scipy.sparse.csr_matrix]) -> torch.Tens
def _csr_collate(arrays: Sequence[scipy.sparse.csr_matrix]) -> torch.Tensor:
"""Collate multiple Scipy CSR matrices to a torch.Tensor with sparse_csr layout."""
stacked = scipy.sparse.vstack(arrays)
return sparse_csr_tensor(
return torch.sparse_csr_tensor(
torch.from_numpy(stacked.indptr),
torch.from_numpy(stacked.indices),
stacked.data,
Expand Down