Skip to content

Commit 4ecf1cd

Browse files
committed
replace node.get_attr('xxx').i by node.get_attr_value('xxx')
1 parent 141b008 commit 4ecf1cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tf2onnx/onnx_opset/math.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,11 @@ def version_1(cls, ctx, node, **kwargs):
251251
# ONNX: Each input value is divided by (bias+(alpha/size)*sum(xi^2 for every xi in the local region))^beta
252252
# TF: sqr_sum[a, b, c, d] = sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
253253
# output = input / (bias + alpha * sqr_sum) ** beta
254-
size = node.get_attr_value("depth_radius") * 2 + 1
255-
254+
depth_radius = node.get_attr("depth_radius")
255+
if depth_radius:
256+
size = depth_radius.i
257+
else:
258+
size = 5
256259
node.set_attr("size", size)
257260
node.set_attr("alpha", size * node.get_attr("alpha").f)
258261

0 commit comments

Comments
 (0)