Skip to content
Snippets Groups Projects

Change Gather and Slice's attributes into intputs

Merged Houssem ROUIS requested to merge hrouis/aidge_onnx:fix_gather_and_slice into dev
Files
2
@@ -38,13 +38,6 @@ def import_gather(onnx_node:onnx.NodeProto, input_nodes:List[Tuple[aidge_core.No
@@ -38,13 +38,6 @@ def import_gather(onnx_node:onnx.NodeProto, input_nodes:List[Tuple[aidge_core.No
print(f"Warning: unsupported attribute(s): {attrs.keys()} for operator gather.")
print(f"Warning: unsupported attribute(s): {attrs.keys()} for operator gather.")
return None
return None
indices_input = input_nodes[1][0].get_operator().get_output(input_nodes[1][1])
gather_node = aidge_core.Gather(axis, name=node_name)
gathered_shape = []
# In case a single index is given, the dimension should be removed so an empty shape is passed
if indices_input.size() > 1:
gathered_shape = indices_input.dims()
gather_node = aidge_core.Gather(indices_input, gathered_shape, axis, name=node_name)
print(f"- {node_name} ({onnx_node.op_type})")
print(f"- {node_name} ({onnx_node.op_type})")
return gather_node
return gather_node
Loading