Shortcuts

is_model_wrapper

class mmengine.model.is_model_wrapper(model, registry=                           Registry of model_wrapper                             ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ Names                             Objects                                  ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ CollosalAIModelWrapper            <class                                                                      'mmengine._strategy.colossalai.Colossal… ColossalAIModelWrapper            <class                                                                      'mmengine._strategy.colossalai.Colossal… DataParallel                      <class                                                                      'torch.nn.parallel.data_parallel.DataPa… DistributedDataParallel           <class                                                                      'torch.nn.parallel.distributed.Distribu… MMDeepSpeedEngineWrapper          <class                                                                      'mmengine._strategy.deepspeed.MMDeepSpe… 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: latest
Versions
latest
stable
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.