Shortcuts

Source code for mmselfsup.utils.misc

# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
from mmengine.model import BaseModel, is_model_wrapper


[docs]def get_model(model: nn.Module) -> BaseModel: """Get model if the input model is a model wrapper. Args: model (nn.Module): A model may be a model wrapper. Returns: BaseModel: The model without model wrapper. """ if is_model_wrapper(model): return model.module else: return model
Read the Docs v: latest
Versions
latest
stable
1.x
0.x
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.