From f769ee9480e2f2928d8295c4d4da301c49ec4e86 Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Thu, 29 Aug 2024 09:41:23 +0000 Subject: [PATCH] Adapt Producer operator. --- aidge_export_cpp/operators.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/aidge_export_cpp/operators.py b/aidge_export_cpp/operators.py index 3f26a72..b3d6d28 100644 --- a/aidge_export_cpp/operators.py +++ b/aidge_export_cpp/operators.py @@ -1,9 +1,7 @@ import os -import shutil import numpy as np from pathlib import Path -from jinja2 import Environment, FileSystemLoader -from aidge_core.export_utils import ExportNode, ExportNodeCpp, operator_register, generate_str, generate_file +from aidge_core.export_utils import ExportNode, ExportNodeCpp, operator_register, generate_file from aidge_export_cpp.utils import ROOT from aidge_export_cpp.utils.converter import numpy_dtype2ctype from aidge_export_cpp.utils.generation import * @@ -68,19 +66,17 @@ class ProducerCPP(ExportNode): if len(self.values.shape) == 4: # Note: export in HWC self.values = np.transpose(self.values, (0, 2, 3, 1)) - def export(self, export_folder: Path, list_configs: list): - - list_configs.append(f"include/parameters/{self.attributes['name']}.h") + def export(self, export_folder: Path): + header_path = f"include/parameters/{self.attributes['name']}.h" export_params( self.attributes['out_name'][0], self.values.reshape(-1), - str(export_folder / "include" / "parameters" / f"{self.attributes['name']}.h")) - - return list_configs + str(export_folder / header_path)) + return [header_path] - def forward(self, list_actions: list): + def forward(self): # A Producer does nothing during forward - return list_actions + return [] @classmethod def exportable(cls, node): return True # TODO add check i/o NCHW -- GitLab