Skip to content

Commit 3469d47

Browse files
jafraustrosvekars
andauthored
Add Accelerator API to ensembling tutorial (#3606)
## Motivation - Enhance distributed tutorial: integrate Accelerator API for devise selection - Integrate the Accelerator API to support multiple accelerators Signed-off-by: jafraustro <[email protected]> Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent 6f77287 commit 3469d47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/ensembling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def forward(self, x):
5050
# minibatch of size 64. Furthermore, lets say we want to combine the predictions
5151
# from 10 different models.
5252

53-
device = 'cuda'
53+
device = torch.accelerator.current_accelerator()
5454
num_models = 10
5555

5656
data = torch.randn(100, 64, 1, 28, 28, device=device)

0 commit comments

Comments
 (0)