The summary() function signature and its arguments:
def summary(
model: nn.Module,
input_size: INPUT_SIZE_TYPE | None = None,
input_data: INPUT_DATA_TYPE | None = None,
batch_dim: int | None = None,
cache_forward_pass: bool | None = None,
col_names: Iterable[str] | None = None,
col_width: int = 25,
depth: int = 3,
device: torch.device | str | None = None,
dtypes: list[torch.dtype] | None = None,
mode: str = "same",
row_settings: Iterable[str] | None = None,
verbose: int | None = None,
**kwargs: Any,
) -> ModelStatistics:
Key Arguments:
model: The PyTorch module to summarize.input_size: Shape of input data (including batch size).input_data: Actual tensors for the forward pass.batch_dim: Index of the batch dimension. If None, assumes the first dimension is the batch.col_names: Columns to display (e.g., "num_params", "mult_adds").depth: How many nested layers to show.device: The device to use for the model and inputs.dtypes: List of dtypes if using input_size with non-FloatTensors.mode: Determines if model.train() or model.eval() is called ("train", "eval", or "same").verbose: 0 (quiet), 1 (default, print summary), 2 (show weights/bias in detail).