Skip to content

Commit

Permalink
Fix print for py2 (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaoshuang authored Feb 6, 2021
1 parent e40ed0f commit f65cd37
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/dygraph/pruning/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def eval(args):
ratios = {}
for param in params:
ratios[param] = args.pruned_ratio
print(f"ratios: {ratios}")
print("ratios: {}".format(ratios))
pruner.prune_vars(ratios, [0])

model = paddle.Model(net, inputs, labels)
Expand Down
2 changes: 1 addition & 1 deletion demo/dygraph/pruning/export_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def export(args):
ratios = {}
for param in params:
ratios[param] = args.pruned_ratio
print(f"ratios: {ratios}")
print("ratios: {}".format(ratios))
pruner.prune_vars(ratios, [0])

param_state_dict = paddle.load(args.checkpoint + ".pdparams")
Expand Down
2 changes: 1 addition & 1 deletion demo/dygraph/pruning/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def compress(args):

for param in net.parameters():
if "conv2d" in param.name:
print(f"{param.name}\t{param.shape}")
print("{}\t{}".format(param.name, param.shape))

net.train()
model = paddle.Model(net, inputs, labels)
Expand Down

0 comments on commit f65cd37

Please sign in to comment.