@@ -11,12 +11,20 @@ Differentiable.
11
11
12
12
# Example
13
13
```jldoctest
14
- julia> v, re = destructure((x=[1.0, 2.0], y=(sin, [3 + 4im ])))
14
+ julia> v, re = destructure((x=[1.0, 2.0], y=(sin, [3.0 + 4.0im ])))
15
15
(ComplexF64[1.0 + 0.0im, 2.0 + 0.0im, 3.0 + 4.0im], Restructure(NamedTuple, ..., 3))
16
16
17
- julia> re([3, 5-im , 7+11im])
17
+ julia> re([3, 5, 7+11im])
18
18
(x = [3.0, 5.0], y = (sin, ComplexF64[7.0 + 11.0im]))
19
19
```
20
+
21
+ If `model` contains various number types, they are promoted to make `vector`,
22
+ and are usually restored by `Restructure`. Such restoration follows the rules
23
+ of `ChainRulesCore.ProjectTo`, and thus will restore floating point precision,
24
+ but will permit more exotic numbers like `ForwardDiff.Dual`.
25
+
26
+ If `model` contains only GPU arrays, then `vector` will also live on the GPU.
27
+ At present, a mixture of GPU and ordinary CPU arrays is undefined behaviour.
20
28
"""
21
29
function destructure (x)
22
30
flat, off, len = _flatten (x)
0 commit comments