edge_codes.append(node.operation.to_forward_code(node.name, node.name, inputs))
output_code = _format_inputs(graph.output_node)
if not output_code:
output_code = "None"
linebreak = "\n "
return _PyTorchModelTemplate.format(
graph_name=("Graph" if graph_name == "_graph" else graph_name),
inputs=input_code,
After Change
for node in nodes:
if node.operation:
pkg_name = node.operation.get_import_pkg()
if pkg_name is not None:
import_pkgs.add(pkg_name)
node_code = node.operation.to_init_code(node.name)
if node_code is not None:
node_codes.append(node_code)