Skip to content

Commit b8c3e86

Browse files
Add str type annotation to device parameter in ToTensorD (#6737)
### Description A simple fix adding `str` type annotation to the `device` parameter in `ToTensorD`, making it consistent with `ToTensor`. As this fix is very simple, I hope it's okay I don't create an issue in advance. Signed-off-by: function2 <function2-llx@outlook.com>
1 parent 38d73e8 commit b8c3e86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/transforms/utility/dictionary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def __init__(
514514
self,
515515
keys: KeysCollection,
516516
dtype: torch.dtype | None = None,
517-
device: torch.device | None = None,
517+
device: torch.device | str | None = None,
518518
wrap_sequence: bool = True,
519519
track_meta: bool | None = None,
520520
allow_missing_keys: bool = False,

0 commit comments

Comments
 (0)