Shortcuts

is_model_wrapper

class mmengine.model.is_model_wrapper(model, registry=                           Registry of model_wrapper                             ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ Names                             Objects                                  ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ DataParallel                      <class                                                                      'torch.nn.parallel.data_parallel.DataPa… DistributedDataParallel           <class                                                                      'torch.nn.parallel.distributed.Distribu… MMDistributedDataParallel         <class                                                                      'mmengine.model.wrappers.distributed.MM… MMFullyShardedDataParallel        <class                                                                      'mmengine.model.wrappers.fully_sharded_… MMSeparateDistributedDataParallel <class                                                                      'mmengine.model.wrappers.seperate_distr… └───────────────────────────────────┴──────────────────────────────────────────┘)[source]

Check if a module is a model wrapper.

The following 4 model in MMEngine (and their subclasses) are regarded as model wrappers: DataParallel, DistributedDataParallel, MMDataParallel, MMDistributedDataParallel. You may add you own model wrapper by registering it to mmengine.registry.MODEL_WRAPPERS.

Parameters
  • model (nn.Module) – The model to be checked.

  • registry (Registry) – The parent registry to search for model wrappers.

Returns

True if the input model is a model wrapper.

Return type

bool

Read the Docs v: v0.7.0
Versions
latest
stable
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.