File tree 2 files changed +10
-2
lines changed
anndata/experimental/pytorch 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,14 @@ def __len__(self):
57
57
58
58
def default_converter (arr , device , pin_memory ):
59
59
if isinstance (arr , torch .Tensor ):
60
- if device != "cpu" :
60
+ if device is not None :
61
61
arr = arr .to (device )
62
62
elif pin_memory :
63
63
arr = arr .pin_memory ()
64
64
elif arr .dtype .name != "category" and np .issubdtype (arr .dtype , np .number ):
65
65
if issparse (arr ):
66
66
arr = arr .toarray ()
67
- if device != "cpu" :
67
+ if device is not None :
68
68
arr = torch .tensor (arr , device = device )
69
69
else :
70
70
arr = torch .tensor (arr )
Original file line number Diff line number Diff line change 1
1
### 0.10.4 {small}` the future `
2
2
3
+ ``` {rubric} New features
4
+ ```
5
+ * ` AnnLoader ` now accepts a ` device ` argument to specify the device to load the data to {pr}` 1240 ` {user}` austinv11 `
6
+
3
7
``` {rubric} Bugfix
4
8
```
5
9
* Only try to use ` Categorical.map(na_action=…) ` in actually supported Pandas ≥2.1 {pr}` 1226 ` {user}` flying-sheep `
10
14
11
15
``` {rubric} Performance
12
16
```
17
+
18
+ ``` {rubric} Deprecations
19
+ ```
20
+ * ` AnnLoader(use_cuda=…) ` is deprecated in favour of ` AnnLoader(device=…) ` {pr}` 1240 ` {user}`austinv11
You can’t perform that action at this time.
0 commit comments