[Python] How to remove the "Parameters" section from Sphinx autoclass output

Discussão em 'Python' iniciado por Stack, Julho 17, 2025.

  1. Stack

    Stack Membro Participativo

    When using autoclass to document a dataclass you get a "Parameters" section after the class docstrings. How can you remove this? Here is a visual of what I'd like to achieve:

    [​IMG]

    Edit: here is the class definition from the example:

    class Dense(Module):
    """A linear transformation applied over the last dimension of the input.

    Attributes:
    features: the number of output features.
    use_bias: whether to add a bias to the output (default: True).
    dtype: the dtype of the computation (default: infer from input and params).
    param_dtype: the dtype passed to parameter initializers (default: float32).
    precision: numerical precision of the computation see `jax.lax.Precision`
    for details.
    """
    features: int
    use_bias: bool = True
    dtype: Optional[Dtype] = None
    param_dtype: Dtype = jnp.float32
    precision: PrecisionLike = None
    kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = default_kernel_init
    bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = zeros

    Continue reading...

Compartilhe esta Página