Skip to content

Commit

Permalink
Merge branch 'FixExport' into 'master'
Browse files Browse the repository at this point in the history
Fix export

See merge request n2d2/n2d2!115
  • Loading branch information
olivierbichler-cea committed Jun 28, 2024
2 parents ae360c9 + bc96033 commit d97fb35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions python/n2d2/deepnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ def get_output_cells(self):
Return the last N2D2 cells in the deepNet
"""
output = []
"""
// Made to support several outputs but breaks regular networks exports
for cell in self.N2D2().getCells():
if len(self._cells[cell].N2D2().getChildrenCells()) == 0:
output.append(self._cells[cell])
return output
"""
for cell in self.N2D2().getLayers()[-1]:
output.append(self._cells[cell])
return output

def draw(self, filename):
N2D2.DrawNet.draw(self._N2D2_object, filename)
Expand Down
2 changes: 1 addition & 1 deletion src/Export/CPP/CPP_CellExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void N2D2::CPP_CellExport::generateActivationScaling(const Cell& cell, std::ofst
const Cell_Frame_Top& cellFrame = dynamic_cast<const Cell_Frame_Top&>(cell);

if (cellFrame.getActivation() == nullptr) {
header << "static const N2D2_Export::NoScaling " << prefix << "_SCALING;\n";
header << "static const N2D2_Export::NoScaling<0> " << prefix << "_SCALING;\n";
return;
}

Expand Down

0 comments on commit d97fb35

Please sign in to comment.