Skip to content

Commit 1d0766a

Browse files
committed
remove none in get_current_accelerator_device
1 parent 14ce8f9 commit 1d0766a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

torchao/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,8 @@ def get_available_devices():
153153

154154

155155
def get_current_accelerator_device():
156-
if torch.accelerator.is_available():
157-
return torch.accelerator.current_accelerator()
158-
else:
159-
return None
156+
assert torch.accelerator.is_available()
157+
return torch.accelerator.current_accelerator()
160158

161159

162160
def get_compute_capability():

0 commit comments

Comments
 (0)