newline += " " + inp.definition_cpp() + "\n"
newline += " std::fill_n({}, {}, 0.);\n".format(inp.cppname, inp.size_cpp())
for out in model.get_output_variables():
newline += " " + out.definition_cpp() + "{};\n"
newline += " std::fill_n({}, {}, 0.);\n".format(out.cppname, out.size())
elif "//hls-fpga-machine-learning insert top-level-function" in line:
newline = line
After Change
newline += " in_begin = in_end;\n"
for out in model.get_output_variables():
// brace-init zeros the array out because we use std=c++0x
newline += " " + self.variable_definition_cpp(model, out) + "{};\n"
// but we can still explicitly zero out if you want
newline += " std::fill_n({}, {}, 0.);\n".format(out.cppname, out.size())
elif "//hls-fpga-machine-learning insert zero" in line:
newline = line
for inp in model.get_input_variables():
newline += " " + self.variable_definition_cpp(model, inp) + "\n"
newline += " std::fill_n({}, {}, 0.);\n".format(inp.cppname, inp.size_cpp())
for out in model.get_output_variables():
newline += " " + self.variable_definition_cpp(model, out) + "{};\n"