logo
Browse Source

Support specifying device via int

Signed-off-by: Kaiyuan Hu <kaiyuan.hu@zilliz.com>
main
Kaiyuan Hu 2 years ago
parent
commit
89b074487f
  1. 2
      isc.py

2
isc.py

@ -76,7 +76,7 @@ class Isc(NNOperator):
super().__init__()
if device is None:
device = 'cuda' if torch.cuda.is_available() else 'cpu'
self.device = device
self.device = device if isinstance(device, str) else 'cpu' if device < 0 else torch.device(device)
self.skip_tfms = skip_preprocess
self.timm_backbone = timm_backbone

Loading…
Cancel
Save