op = node.op.lower() // type of the unary operator
if op in ["all", "any"]:
op = "prod" if op == "all" else "sum"
graph = self._get_current_graph()
reduction_indices = [graph[node.inputs[1]].value.val]
func = getattr(self._get_builder(), "add_reduce_" + op)
layer = func(
name=node.name,
After Change
if len(input_names) == 2:
axes = input_nodes[1].value.val
reduction_indices = list(axes) if isinstance(axes, Iterable) else [axes]
elif "reduction_indices" in node.attr:
reduction_indices = node.attr["reduction_indices"]
else:
reduction_indices = node.attr["axis"]