Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nobuco-dev
Submodule nobuco-dev added at fda427
10 changes: 3 additions & 7 deletions nobuco/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,9 @@ def pytorch_to_keras(
constants_to_variables: bool = True,
full_validation: bool = True,
validation_tolerance: float = 1e-4,
return_outputs_pt: bool = False,
save_trace_html: bool = False,
debug_traces: TraceLevel = TraceLevel.DEFAULT,
) -> keras.Model | Tuple[keras.Model, object]:
) -> Tuple[keras.Model, object, Dict[PytorchNode, ValidationResult], Dict[PytorchNode, ConversionResult]]:
"""Converts Pytorch program to Keras graph

Args:
Expand Down Expand Up @@ -364,8 +363,5 @@ def pytorch_to_keras(
elapsed = time.time() - start
print(f'Conversion complete. Elapsed time: {elapsed:.2f} sec.')

if return_outputs_pt:
outputs_pt = node_hierarchy.node.outputs
return keras_model, outputs_pt
else:
return keras_model
outputs_pt = node_hierarchy.node.outputs
return keras_model, outputs_pt, validation_result_dict, conversion_result_dict