Skip to content

Commit dd9096b

Browse files
authored
Update docs_nnx/guides/transforms.ipynb
1 parent 5169897 commit dd9096b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs_nnx/guides/transforms.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@
639639
"\n",
640640
"While Python allows for passing objects as closures to functions, this is generally not supported by Flax NNX transforms. The reason is that because Modules are mutable it is very easy to capture tracer into a Module created outside of the transform, this is silent error in JAX. To avoid this, Flax NNX checks that the Modules and Variables being mutated are passed as arguments to the transformed function.\n",
641641
"\n",
642-
"For example, if we have stateful Module such as `Counter` that increments a counter every time it is called, and we try to pass it as a closure to a function decorated with `nnx.jit`, we would be leaking the tracer. However Flax NNX will raise an error instead to prevent this:"
642+
"For example, if we have a stateful Module such as `Counter` that increments a counter every time it is called, and we try to pass it as a closure to a function decorated with `nnx.jit`, we would be leaking the tracer. However Flax NNX will raise an error instead to prevent this:"
643643
]
644644
},
645645
{

0 commit comments

Comments
 (0)