Skip to content

Commit 9c91491

Browse files
style cleanups
1 parent e252e46 commit 9c91491

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/layers/upsample.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
Upsample(mode=:nearest; scale=nothing, size=nothing)
2+
Upsample(mode = :nearest; scale = nothing, size = nothing)
33
44
An upsampling layer.
55
66
`scale` is a number or a tuple of numbers
77
representing the output rescaling factor along each spatial dimension.
88
For integer `scale`, all but the last 2 dimensions (channel and batch)
9-
will rescaled by the same factor.
9+
will be rescaled by the same factor.
1010
1111
It is also possible to directly specify the output spatial `size`,
1212
as an alternative to using `scale`.
@@ -19,13 +19,13 @@ and corresponding NNlib's methods are:
1919
# Examples
2020
2121
```juliarepl
22-
julia> m = Upsample(scale=(2, 3))
22+
julia> m = Upsample(scale = (2, 3))
2323
Upsample(:nearest, scale=(2, 3))
2424
2525
julia> m(ones(2, 2, 1, 1)) |> size
2626
(4, 6, 1, 1)
2727
28-
julia> m = Upsample(:bilinear, size=(4, 5))
28+
julia> m = Upsample(:bilinear, size = (4, 5))
2929
Upsample(:bilinear, size=(4, 5))
3030
3131
julia> m(ones(2, 2, 1, 1)) |> size
@@ -36,7 +36,7 @@ struct Upsample{Mode,S,T}
3636
size::T
3737
end
3838

39-
function Upsample(mode::Symbol=:nearest; scale=nothing, size=nothing)
39+
function Upsample(mode = :nearest; scale = nothing, size = nothing)
4040
mode in [:nearest, :bilinear] ||
4141
throw(ArgumentError("mode=:$mode is not supported."))
4242
if ~((scale === nothing) (size === nothing))
@@ -61,8 +61,8 @@ end
6161
function Base.show(io::IO, u::Upsample{mode}) where {mode}
6262
print(io, "Upsample(")
6363
print(io, ":", mode)
64-
u.scale !== nothing && print(io, ", scale=$(u.scale)")
65-
u.size !== nothing && print(io, ", size=$(u.size)")
64+
u.scale !== nothing && print(io, ", scale = $(u.scale)")
65+
u.size !== nothing && print(io, ", size = $(u.size)")
6666
println(io, ")")
6767
end
6868

@@ -79,4 +79,3 @@ end
7979

8080
(m::PixelShuffle)(x) = NNlib.pixel_shuffle(x, m.r)
8181

82-

0 commit comments

Comments
 (0)