Skip to content

Commit e110d74

Browse files
committed
kwarg types
1 parent bf2071f commit e110d74

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/rulesets/Base/mapreduce.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ end
223223
##### `cumprod`
224224
#####
225225

226-
function rrule(::typeof(cumprod), x::AbstractVector{<:Real}; dims=1)
226+
function rrule(::typeof(cumprod), x::AbstractVector{<:Real}; dims::Integer=1)
227227
y = cumprod(x; dims=dims) # does nothing unless dims == 1
228228
function cumprod_pullback_1(dy)
229229
dx_thunk = InplaceableThunk(
@@ -244,9 +244,8 @@ function rrule(::typeof(cumprod), x::AbstractVector{<:Real}; dims=1)
244244
return y, cumprod_pullback_1
245245
end
246246

247-
function rrule(::typeof(cumprod), x::AbstractArray{<:Real}; dims)
247+
function rrule(::typeof(cumprod), x::AbstractArray{<:Real}; dims::Integer)
248248
y = cumprod(x; dims=dims)
249-
@assert dims isa Integer
250249
function cumprod_pullback_2(dy)
251250
dx_thunk = InplaceableThunk(
252251
@thunk if dims <= ndims(x)

0 commit comments

Comments
 (0)