Skip to content

Commit

Permalink
Merge pull request #4236 from google:nnx-improve-docs-3
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 680950137
  • Loading branch information
Flax Authors committed Oct 1, 2024
2 parents dfc86d5 + cac222a commit ef5248b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
31 changes: 31 additions & 0 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- htmlzip
- epub
# - pdf

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- all
- testing
- docs
4 changes: 1 addition & 3 deletions docs_nnx/nnx_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@
"source": [
"`nnx.Variable`'s inner values can be accessed using the `.value` property, however\n",
"for convenience they implement all numeric operators and can be used directly in\n",
"arithmetic expressions (as shown above). Additionally, Variables can passed\n",
"to any JAX function as they implement the `__jax_array__` protocol (as long as their\n",
"inner value is a JAX array).\n",
"arithmetic expressions (as shown above).\n",
"\n",
"To actually initialize a Module you simply call the constructor, all the parameters\n",
"of a Module are usually created eagerly. Since Modules hold their own state methods\n",
Expand Down
4 changes: 1 addition & 3 deletions docs_nnx/nnx_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class Linear(nnx.Module):

`nnx.Variable`'s inner values can be accessed using the `.value` property, however
for convenience they implement all numeric operators and can be used directly in
arithmetic expressions (as shown above). Additionally, Variables can passed
to any JAX function as they implement the `__jax_array__` protocol (as long as their
inner value is a JAX array).
arithmetic expressions (as shown above).

To actually initialize a Module you simply call the constructor, all the parameters
of a Module are usually created eagerly. Since Modules hold their own state methods
Expand Down

0 comments on commit ef5248b

Please sign in to comment.