Skip to content

Commit 40ac4bd

Browse files
datumboxfacebook-github-bot
authored andcommitted
[fbsync] Fix minor issues with model tests. (#5576)
Reviewed By: vmoens Differential Revision: D34878988 fbshipit-source-id: ec196a6ed81f81caa0624749c0420b7419c1d8f6
1 parent 3140045 commit 40ac4bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _get_expected_file(name=None):
8181

8282
# Note: for legacy reasons, the reference file names all had "ModelTest.test_" in their names
8383
# We hardcode it here to avoid having to re-generate the reference files
84-
expected_file = expected_file = os.path.join(expected_file_base, "ModelTester.test_" + name)
84+
expected_file = os.path.join(expected_file_base, "ModelTester.test_" + name)
8585
expected_file += "_expect.pkl"
8686

8787
if not ACCEPT and not os.path.exists(expected_file):
@@ -665,6 +665,7 @@ def check_out(out):
665665
assert len(out) == 1
666666

667667
def compact(tensor):
668+
tensor = tensor.cpu()
668669
size = tensor.size()
669670
elements_per_sample = functools.reduce(operator.mul, size[1:], 1)
670671
if elements_per_sample > 30:

0 commit comments

Comments
 (0)