Skip to content

Commit 2385358

Browse files
committed
Fix docstring
1 parent 6af147a commit 2385358

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/utils.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ ofeltype(x, y) = convert(float(eltype(x)), y)
3434
epseltype(x) = eps(float(eltype(x)))
3535

3636
"""
37-
rng_from_array()
38-
rng_from_array(x)
37+
rng_from_array([x])
3938
4039
Create an instance of the RNG most appropriate for `x`.
4140
The current defaults are:
@@ -45,13 +44,13 @@ The current defaults are:
4544
- `x isa CuArray`: `CUDA.default_rng()`
4645
When `x` is unspecified, it is assumed to be a `AbstractArray`.
4746
"""
47+
rng_from_array(::AbstractArray) = rng_from_array()
48+
rng_from_array(::CuArray) = CUDA.default_rng()
4849
if VERSION >= v"1.7"
4950
rng_from_array() = Random.default_rng()
5051
else
5152
rng_from_array() = Random.GLOBAL_RNG
5253
end
53-
rng_from_array(::AbstractArray) = rng_from_array()
54-
rng_from_array(::CuArray) = CUDA.default_rng()
5554

5655
"""
5756
glorot_uniform([rng=GLOBAL_RNG], dims...)

0 commit comments

Comments
 (0)