Skip to content

Commit f485891

Browse files
authored
out-of-place transpose in reverse (#155)
1 parent e71ee9e commit f485891

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchtext/data/field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def reverse(self, batch):
331331
print("Please install revtok.")
332332
raise
333333
if not self.batch_first:
334-
batch.t_()
334+
batch = batch.t()
335335
with torch.cuda.device_of(batch):
336336
batch = batch.tolist()
337337
batch = [[self.vocab.itos[ind] for ind in ex] for ex in batch] # denumericalize

0 commit comments

Comments
 (0)