冻结param的3种方式
py
for param in net.lstm.parameters():
param.requires_grad = True
net.lstm.requires_grad = True # 无效
net.lstm.state_dict()['weight_ih_l0'].requires_grad=False
net.lstm.weight_ih_l0.requires_grad = False
# dir(net.lstm) to validate attributes of lstm module