Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

Commit d944083

Browse files
committed
Fix linting error
1 parent 128227c commit d944083

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

torchnlp/word_to_vector/pretrained_word_vectors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
from __future__ import unicode_literals
3232

33-
import array
3433
import io
3534
import logging
3635
import os
@@ -137,7 +136,7 @@ def cache(self, name, cache, url=None):
137136
entries = line.rstrip().split(b" " if binary_lines else " ")
138137

139138
word, entries = entries[0], entries[1:]
140-
if dim is None and len(entries) > 1:
139+
if dim is None and vectors is None and len(entries) > 1:
141140
dim = len(entries)
142141
vectors = torch.empty(len(lines), dim, dtype=torch.float)
143142
elif len(entries) == 1:

0 commit comments

Comments
 (0)