Skip to content

Commit a88e5b6

Browse files
committed
no need to use relu, clip will keep the value between 0 and 6
1 parent e59757b commit a88e5b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tf2onnx/onnx_opset/math.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ class Relu6:
135135
@classmethod
136136
def version_4(cls, ctx, node, **kwargs):
137137
# relu6 = min(max(features, 0), 6)
138-
node.type = "Relu"
139-
clip_name = utils.make_name(node.name)
140-
clip_node = ctx.insert_new_node_on_output("Clip", node.output[0], name=clip_name, min=0.0, max=6.0)
141-
ctx.copy_shape(node.output[0], clip_node.output[0])
138+
# relu6 = min(max(features, 0), 6)
139+
node.type = "Clip"
140+
node.set_attr("min", 0.0)
141+
node.set_attr("max", 6.0)
142142

143143

144144
@tf_op("Rsqrt")

0 commit comments

Comments
 (0)