Skip to content

Commit 4c443c1

Browse files
committed
Fix tests
Signed-off-by: Y-T-G <[email protected]>
1 parent 164ce22 commit 4c443c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/unit/torch/nas/test_evaluate_constraints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_evaluate_constraints(model_and_input_func):
4747
# NOTE: using param_num here instead of param_num_from_forward to check
4848
# correctness of the function.
4949
"params": param_num(model, unit=1.0),
50-
"flops": profile_macs(model, args) / 1.0,
50+
"flops": 2 * profile_macs(model, args) / 1.0,
5151
}
5252

5353
assert actual_results == expected_results
@@ -83,7 +83,7 @@ def test_percent_limits():
8383
cf = ConstraintsFunc(model, constraints=constraints, dummy_input=args)
8484

8585
remove_bn(model)
86-
max_flops = profile_macs(model, args)
86+
max_flops = 2 * profile_macs(model, args)
8787
max_params = param_num(model, unit=1.0)
8888
expected_results = {
8989
# NOTE: using trainable_param_num here instead of trainable_param_num_from_forward to check

0 commit comments

Comments
 (0)