Skip to content

[Docs] Add docstrings for nn.Module classes and core APIs in relax.frontend.nn#19387

Merged
MasterJH5574 merged 1 commit into
apache:mainfrom
tlopex:doc202
Apr 11, 2026
Merged

[Docs] Add docstrings for nn.Module classes and core APIs in relax.frontend.nn#19387
MasterJH5574 merged 1 commit into
apache:mainfrom
tlopex:doc202

Conversation

@tlopex

@tlopex tlopex commented Apr 11, 2026

Copy link
Copy Markdown
Member

This pr adds some docstrings for important APIs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the documentation for the Relax frontend's neural network modules and core functions. It adds detailed docstrings, including parameter descriptions and return types, for various layers such as Linear, Convolutional, and Normalization modules, as well as the JIT compilation and KVCache utilities. The review feedback suggests a minor improvement to the TimestepEmbedding documentation to explicitly mention the supported activation functions, ensuring consistency with other documented parameters.

Dimensionality of the output. If ``None``, defaults to *time_embed_dim*.

post_act_fn : Optional[str]
Optional post-activation applied after the second linear layer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The documentation for post_act_fn could be more specific. Similar to act_fn, it seems only "silu" is supported for post-activation. It would be helpful to mention this limitation in the docstring to avoid runtime errors.

Suggested change
Optional post-activation applied after the second linear layer.
Optional post-activation applied after the second linear layer. Currently only ``"silu"`` is supported.

@MasterJH5574 MasterJH5574 merged commit 4d812a1 into apache:main Apr 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants