modified onnx leakyrelu alpha

This commit is contained in:
xgqdut2016 2024-04-28 16:03:14 +08:00
parent e6b98fd652
commit ef4646ec89
1 changed files with 4 additions and 3 deletions

View File

@ -491,12 +491,13 @@ class OnnxStub:
tensors.get(node.output[0]),
)
elif node.op_type == "LeakyRelu":
attributes = _parse_attribute(node, {"alpha": 0.01})
(alpha) = (attributes[name] for name in ["alpha"])
tensors[node.output[0]] = self.handler.leakyrelu(
tensors[node.input[0]],
tensors.get(node.output[0]),
alpha,
next(
(attr.f for attr in node.attribute if attr.name == "alpha"),
0.01,
),
)
elif node.op_type == "Silu":
tensors[node.output[0]] = self.handler.silu(