Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Allow train model when arg no-cuda is True#3

Open
tomassosorio wants to merge 1 commit into
MicrosoftLearning:masterfrom
tomassosorio:allow-train-using-cpu-when-no-cuda-True
Open

Allow train model when arg no-cuda is True#3
tomassosorio wants to merge 1 commit into
MicrosoftLearning:masterfrom
tomassosorio:allow-train-using-cpu-when-no-cuda-True

Conversation

@tomassosorio

Copy link
Copy Markdown

Module: 00

Lab/Demo: 02-train-model

Fixes #

  • Allow training model using CPU if no-cuda arg is True

Changes proposed in this pull request:
from
device = torch.device("cuda")
to
device = torch.device("cuda" if use_cuda else "cpu")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant