Skip to content

Commit af32ac2

Browse files
authored
Merge pull request NVIDIA#456 from NVIDIA/sharathts-patch-1
Fix to load Google's checkpoint
2 parents 5175cc7 + a9c997c commit af32ac2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

PyTorch/LanguageModeling/BERT/modeling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def load_tf_weights_in_bert(model, tf_checkpoint_path):
106106
if m_name[-11:] == '_embeddings':
107107
pointer = getattr(pointer, 'weight')
108108
elif m_name == 'kernel':
109-
array = np.transpose(array)
109+
array = np.ascontiguousarray(np.transpose(array))
110110
try:
111111
assert pointer.shape == array.shape
112112
except AssertionError as e:

0 commit comments

Comments
 (0)