Skip to content

Commit

Permalink
Merge branch 'reformat' into fix-descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghan-iapcm authored Jan 11, 2024
2 parents ab085e7 + f60be1f commit 3fecff5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

def torch2tf(torch_name):
fields = torch_name.split('.')
element_id = int(fields[2])
offset = int(fields[2] == "networks")
element_id = int(fields[2 + offset])
if fields[0] == 'descriptor':
layer_id = int(fields[4]) + 1
weight_type = fields[5]
layer_id = int(fields[4 + offset]) + 1
weight_type = fields[5 + offset]
return 'filter_type_all/%s_%d_%d:0' % (weight_type, layer_id, element_id)
elif fields[3] == 'deep_layers':
layer_id = int(fields[4])
Expand Down

0 comments on commit 3fecff5

Please sign in to comment.