MCPcopy Create free account
hub / github.com/XLearning-SCU/2022-CVPR-DART / remove_fc

Function remove_fc

resnet.py:150–156  ·  view source on GitHub ↗

Remove the fc layer parameters from state_dict.

(state_dict)

Source from the content-addressed store, hash-verified

148
149
150def remove_fc(state_dict):
151 """Remove the fc layer parameters from state_dict."""
152 # for key, value in state_dict.items():
153 for key, value in list(state_dict.items()):
154 if key.startswith('fc.'):
155 del state_dict[key]
156 return state_dict
157
158
159def resnet18(pretrained=False, **kwargs):

Callers 5

resnet18Function · 0.85
resnet34Function · 0.85
resnet50Function · 0.85
resnet101Function · 0.85
resnet152Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected