Skip to content

Commit 52374e0

Browse files
committed
removing device setup to speed up build
1 parent 7fc2c9b commit 52374e0

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

intermediate_source/char_rnn_classification_tutorial.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,6 @@
5050
general
5151
"""
5252

53-
######################################################################
54-
# Preparing Torch
55-
# ==========================
56-
#
57-
# Set up torch to default to the right device use GPU acceleration depending on your hardware (CPU or CUDA).
58-
#
59-
60-
import torch
61-
62-
# Check if CUDA is available
63-
device = torch.device('cpu')
64-
if torch.cuda.is_available():
65-
device = torch.device('cuda')
66-
67-
torch.set_default_device(device)
68-
print(f"Using device = {torch.get_default_device()}")
69-
7053
######################################################################
7154
# Preparing the Data
7255
# ==================
@@ -82,6 +65,7 @@
8265
# The first step is to define and clean our data. Initially, we need to convert Unicode to plain ASCII to
8366
# limit the RNN input layers. This is accomplished by converting Unicode strings to ASCII and allowing only a small set of allowed characters.
8467

68+
import torch
8569
import string
8670
import unicodedata
8771

0 commit comments

Comments
 (0)