slip
copied
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions
9 lines
216 B
9 lines
216 B
2 years ago
|
import torch
|
||
|
|
||
|
def get_model(model):
|
||
|
if isinstance(model, torch.nn.DataParallel) \
|
||
|
or isinstance(model, torch.nn.parallel.DistributedDataParallel):
|
||
|
return model.module
|
||
|
else:
|
||
|
return model
|