Skip to content

Commit f7a79f8

Browse files
authored
Update transformer_tutorial.py
1 parent 038b72c commit f7a79f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/transformer_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def batchify(data, bsz):
194194
def get_batch(source, i):
195195
seq_len = min(bptt, len(source) - 1 - i)
196196
data = source[i:i+seq_len]
197-
target = source[i+1:i+1+seq_len].view(-1)
197+
target = source[i+1:i+1+seq_len].reshape(-1)
198198
return data, target
199199

200200

0 commit comments

Comments
 (0)