mmengine.analysis.get_model_complexity_info¶
- mmengine.analysis.get_model_complexity_info(model, input_shape, inputs=None, show_table=True, show_arch=True)[source]¶
Interface to get the complexity of a model.
- Parameters
model (nn.Module) – The model to analyze.
input_shape (tuple) – The input shape of the model.
inputs (torch.Tensor, optional) – The input tensor of the model. If not given the input tensor will be generated automatically with the given input_shape.
show_table (bool) – Whether to show the complexity table. Defaults to True.
show_arch (bool) – Whether to show the complexity arch. Defaults to True.
- Returns
The complexity information of the model.
- Return type