Skip to content
Snippets Groups Projects
Commit acd012c0 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Remove various print.

parent 8800bafa
No related branches found
No related tags found
3 merge requests!279v0.4.0,!253v0.4.0,!163Export refactor
Pipeline #55303 failed
...@@ -61,7 +61,6 @@ class ExportLib(aidge_core.OperatorImpl): ...@@ -61,7 +61,6 @@ class ExportLib(aidge_core.OperatorImpl):
def get_export_node(self, spec: aidge_core.aidge_core.ImplSpec): def get_export_node(self, spec: aidge_core.aidge_core.ImplSpec):
for registered_spec, export_node in self._export_node_registry[self.get_operator().type()]: for registered_spec, export_node in self._export_node_registry[self.get_operator().type()]:
print(f"{registered_spec} vs {spec}")
if registered_spec == spec: if registered_spec == spec:
return export_node return export_node
...@@ -85,7 +84,6 @@ class ExportLib(aidge_core.OperatorImpl): ...@@ -85,7 +84,6 @@ class ExportLib(aidge_core.OperatorImpl):
else: else:
# Equivalent to aidge_core.register_ConvOp("ExportLibX", ExportLibX) # Equivalent to aidge_core.register_ConvOp("ExportLibX", ExportLibX)
aidge_core.__getattribute__(register_func)(cls._name, cls) aidge_core.__getattribute__(register_func)(cls._name, cls)
aidge_core.Log.info(f"Registring operator {type} to {cls._name}")
return Wrapper return Wrapper
return decorator return decorator
...@@ -100,7 +98,6 @@ class ExportLib(aidge_core.OperatorImpl): ...@@ -100,7 +98,6 @@ class ExportLib(aidge_core.OperatorImpl):
cls._export_node_registry[type] = [] cls._export_node_registry[type] = []
cls._export_node_registry[type].append((spec, operator)) cls._export_node_registry[type].append((spec, operator))
aidge_core.Log.info(f"Registring metaop {type} to {cls._name}")
aidge_core.register_MetaOperatorOp([cls._name, type], cls) aidge_core.register_MetaOperatorOp([cls._name, type], cls)
spec.attrs.add_attr("type", type) # MetaOperator specs need to verify the type spec.attrs.add_attr("type", type) # MetaOperator specs need to verify the type
return Wrapper return Wrapper
......
...@@ -43,15 +43,17 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = ...@@ -43,15 +43,17 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib =
if export_lib is not None: if export_lib is not None:
aidge_core.Log.debug(f"Setting backend {export_lib._name} to {node.name()}[{node.type()}].") aidge_core.Log.debug(f"Setting backend {export_lib._name} to {node.name()}[{node.type()}].")
node.get_operator().set_backend(export_lib._name) node.get_operator().set_backend(export_lib._name)
elif not isinstance(op_impl, ExportLib):
op_impl = node.get_operator().get_impl()
if op_impl is None:
raise RuntimeError(f"Operator {node.name()}[{node.type()}] doesn't have an implementation.")
if not isinstance(op_impl, ExportLib):
raise RuntimeError(f"Operator {node.name()}[{node.type()}] doesn't have an exportable backend ({op_impl}).") raise RuntimeError(f"Operator {node.name()}[{node.type()}] doesn't have an exportable backend ({op_impl}).")
is_input = node in graphview.get_input_nodes() is_input = node in graphview.get_input_nodes()
is_output = node in graphview.get_output_nodes() is_output = node in graphview.get_output_nodes()
op_impl = node.get_operator().get_impl()
if op_impl is None:
raise RuntimeError(f"Operator {node.name()}[{node.type()}] doesn't have an implementation.")
required_specs = op_impl.get_required_spec() required_specs = op_impl.get_required_spec()
specs = op_impl.get_best_match(required_specs) specs = op_impl.get_best_match(required_specs)
export_node = op_impl.get_export_node(specs) export_node = op_impl.get_export_node(specs)
......
...@@ -124,7 +124,6 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs) ...@@ -124,7 +124,6 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs)
name = attrName.substr(0, (qualifierPos - attrName.begin())); name = attrName.substr(0, (qualifierPos - attrName.begin()));
qualifier = attrName.substr((qualifierPos - attrName.begin())+1); qualifier = attrName.substr((qualifierPos - attrName.begin())+1);
} }
fmt::println("{} : {}", name, qualifier);
const bool mandatory = (qualifier == "!"); const bool mandatory = (qualifier == "!");
if (mandatory) { if (mandatory) {
// Required attribute: // Required attribute:
......
...@@ -77,7 +77,6 @@ std::string Aidge::MetaOperator_Op::backend() const noexcept { ...@@ -77,7 +77,6 @@ std::string Aidge::MetaOperator_Op::backend() const noexcept {
} }
void Aidge::MetaOperator_Op::setBackend(const std::string &name, Aidge::DeviceIdx_t device) { void Aidge::MetaOperator_Op::setBackend(const std::string &name, Aidge::DeviceIdx_t device) {
fmt::println("Setting backend {} for {}", name, type());
if (Registrar<MetaOperator_Op>::exists({name, type()})) { if (Registrar<MetaOperator_Op>::exists({name, type()})) {
// A custom implementation exists for this meta operator // A custom implementation exists for this meta operator
mImpl = Registrar<MetaOperator_Op>::create({name, type()})(*this); mImpl = Registrar<MetaOperator_Op>::create({name, type()})(*this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment