Skip to content

Commit cba299b

Browse files
committed
More clarification
1 parent 9b06730 commit cba299b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/loading.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ Recursively walks `dst` and `src` together using [`Functors.children`](@ref),
3333
and calling `copyto!` on parameter arrays.
3434
Non-array elements (such as activation functions) are not copied
3535
and do not need to match between `dst` and `src`.
36-
Inactive parameters, encoded by `false` in place on an array,
37-
can be copied to and from all-zero arrays.
38-
Attempting to copy a non-zero array to/from an inactive parameter will throw an error.
36+
Inactive parameters can be encoded by using the boolean value `false` instead of an array.
37+
If `dst == false` and `src` is an all-zero array, no error will be raised (and no values copied);
38+
however, attempting to copy a non-zero array to an inactive parameter will throw an error.
39+
Likewise, copying `src == false` to any `dst` array is valid, but copying `src == true` will error.
3940
4041
Throws an error when:
4142
- `dst` and `src` do not share the same fields (at any level)

0 commit comments

Comments
 (0)