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
8 lines
216 B
8 lines
216 B
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
|