From d3caf01148cbcfbd7cba6e32198aab880d231aa1 Mon Sep 17 00:00:00 2001 From: wjj19950828 Date: Wed, 20 Jul 2022 11:54:40 +0800 Subject: [PATCH] deal with comments --- x2paddle/op_mapper/pytorch2paddle/prim2code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x2paddle/op_mapper/pytorch2paddle/prim2code.py b/x2paddle/op_mapper/pytorch2paddle/prim2code.py index 4834cd9..673456c 100755 --- a/x2paddle/op_mapper/pytorch2paddle/prim2code.py +++ b/x2paddle/op_mapper/pytorch2paddle/prim2code.py @@ -72,7 +72,7 @@ def prim_add_(layer, forward_func=[], layer_id=None, different_attrs=None): - if layer.attrs["alpha"] == 1: + if abs(layer.attrs["alpha"] - 1.) < 1e-6: line = "{} = {} + {}".format(layer.outputs[0], get_value(layer, "x", different_attrs), get_value(layer, "y", different_attrs)) -- GitLab