Skip to content

Commit d97fb35

Browse files
Merge branch 'FixExport' into 'master'
Fix export See merge request n2d2/n2d2!115
2 parents ae360c9 + bc96033 commit d97fb35

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

python/n2d2/deepnet.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,16 @@ def get_output_cells(self):
111111
Return the last N2D2 cells in the deepNet
112112
"""
113113
output = []
114+
"""
115+
// Made to support several outputs but breaks regular networks exports
114116
for cell in self.N2D2().getCells():
115117
if len(self._cells[cell].N2D2().getChildrenCells()) == 0:
116118
output.append(self._cells[cell])
117119
return output
120+
"""
121+
for cell in self.N2D2().getLayers()[-1]:
122+
output.append(self._cells[cell])
123+
return output
118124

119125
def draw(self, filename):
120126
N2D2.DrawNet.draw(self._N2D2_object, filename)

src/Export/CPP/CPP_CellExport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void N2D2::CPP_CellExport::generateActivationScaling(const Cell& cell, std::ofst
9696
const Cell_Frame_Top& cellFrame = dynamic_cast<const Cell_Frame_Top&>(cell);
9797

9898
if (cellFrame.getActivation() == nullptr) {
99-
header << "static const N2D2_Export::NoScaling " << prefix << "_SCALING;\n";
99+
header << "static const N2D2_Export::NoScaling<0> " << prefix << "_SCALING;\n";
100100
return;
101101
}
102102

0 commit comments

Comments
 (0)