File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change 50
50
general
51
51
"""
52
52
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
-
70
53
######################################################################
71
54
# Preparing the Data
72
55
# ==================
82
65
# The first step is to define and clean our data. Initially, we need to convert Unicode to plain ASCII to
83
66
# limit the RNN input layers. This is accomplished by converting Unicode strings to ASCII and allowing only a small set of allowed characters.
84
67
68
+ import torch
85
69
import string
86
70
import unicodedata
87
71
You can’t perform that action at this time.
0 commit comments