From 82c7c780a6b0b8d728fdf9f2df2d820a78617e5b Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 11 Feb 2023 13:19:15 -0800 Subject: Update 07-autodiff.md --- docs/user-guide/07-autodiff.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/user-guide') diff --git a/docs/user-guide/07-autodiff.md b/docs/user-guide/07-autodiff.md index 488800a98..ddd4fe342 100644 --- a/docs/user-guide/07-autodiff.md +++ b/docs/user-guide/07-autodiff.md @@ -387,7 +387,7 @@ DifferentialPair derivative(DifferentialPair p0, inout DifferentialPair)]` to specify a maximum number of iterations. This will be used by compiler to allocate space to store intermediate data. If the actual number of iterations exceeds the provided maximum, the behavior is undefined. +- Loops: In a backward differentiable function, loops currently cannot have `continue` statements although `break` statements are supported. Loops must use the attribute `[MaxIters()]` to specify a maximum number of iterations. This will be used by compiler to allocate space to store intermediate data. If the actual number of iterations exceeds the provided maximum, the behavior is undefined. You can always mark loops with the `[ForceUnroll]` attribute to instruct the Slang compiler to unroll the loop before generating derivative propagation functions. Unrolled loops will be treated the same way as ordinary code and is not subject to any additional restrictions. The above restrictions do not apply if a user-defined derivative or backward propagation function is provided. -- cgit v1.2.3