Skip to content

Commit e14e477

Browse files
committed
Added short names support.
1 parent 4c7793d commit e14e477

File tree

2 files changed

+186
-58
lines changed

2 files changed

+186
-58
lines changed

pytorch2keras/converter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_node_id(node):
5959

6060
def pytorch_to_keras(
6161
model, args, input_shape,
62-
change_ordering=False, training=False, verbose=False
62+
change_ordering=False, training=False, verbose=False, short_names=False,
6363
):
6464
"""
6565
By given pytorch model convert layers with specified convertors.
@@ -71,6 +71,7 @@ def pytorch_to_keras(
7171
change_ordering: change CHW to HWC
7272
training: switch model to training mode
7373
verbose: verbose output
74+
short_names: use shorn names for keras layers
7475
7576
Returns:
7677
model: created keras model.
@@ -161,7 +162,8 @@ def pytorch_to_keras(
161162
node_attrs,
162163
node_weights_name, node_id,
163164
node_input_names,
164-
layers, state_dict
165+
layers, state_dict,
166+
short_names
165167
)
166168
if node_id in graph_outputs:
167169
outputs.append(layers[node_id])

0 commit comments

Comments
 (0)