Cleanup TorchVision related functions (#18790)
This commit is contained in:
parent
066c5443f5
commit
5306a8cc1f
4 changed files with 8 additions and 13 deletions
|
|
@ -1060,12 +1060,16 @@ def parse_model(d, ch, verbose=True): # model_dict, input_channels(3)
|
|||
m.legacy = legacy
|
||||
elif m is RTDETRDecoder: # special case, channels arg must be passed in index 1
|
||||
args.insert(1, [ch[x] for x in f])
|
||||
elif m in frozenset({CBLinear, TorchVision, Index}):
|
||||
elif m is CBLinear:
|
||||
c2 = args[0]
|
||||
c1 = ch[f]
|
||||
args = [c1, c2, *args[1:]]
|
||||
elif m is CBFuse:
|
||||
c2 = ch[f[-1]]
|
||||
elif m in frozenset({TorchVision, Index}):
|
||||
c2 = args[0]
|
||||
c1 = ch[f]
|
||||
args = [*args[1:]]
|
||||
else:
|
||||
c2 = ch[f]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue