Skip to content

Commit 0a4d4dd

Browse files
bors[bot]ToucheSir
andauthored
Merge #1798
1798: Fix failing `params` doctests r=DhairyaLGandhi a=ToucheSir ```julia julia> [[1, 2, 3], [4.0]] 2-element Vector{Vector{Float64}}: [1.0, 2.0, 3.0] [4.0] julia> [[1, 2, 3], [4]] 2-element Vector{Vector{Int64}}: [1, 2, 3] [4] ``` ### PR Checklist - [x] Tests are added - [x] Documentation, if applicable Co-authored-by: Brian Chen <ToucheSir@users.noreply.github.com>
2 parents 0d3bd0f + a37aa08 commit 0a4d4dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/functor.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ BatchNorm(2, relu) # 4 parameters, plus 4 non-trainable
6969
julia> params(bn) # only the trainable parameters
7070
Params([Float32[0.0, 0.0], Float32[1.0, 1.0]])
7171
72-
julia> params([1, 2, 3], [4.0]) # one or more arrays of numbers
73-
Params([[1, 2, 3], [4.0]])
72+
julia> params([1, 2, 3], [4]) # one or more arrays of numbers
73+
Params([[1, 2, 3], [4]])
7474
75-
julia> params([[1, 2, 3], [4.0]]) # unpacks array of arrays
76-
Params([[1, 2, 3], [4.0]])
75+
julia> params([[1, 2, 3], [4]]) # unpacks array of arrays
76+
Params([[1, 2, 3], [4]])
7777
7878
julia> params(1, [2 2], (alpha=[3,3,3], beta=Ref(4), gamma=sin)) # ignores scalars, unpacks NamedTuples
7979
Params([[2 2], [3, 3, 3]])

0 commit comments

Comments
 (0)