Skip to content

Commit cb01743

Browse files
committed
Revert "rename InplaceableThunk InplaceThunk"
This reverts commit 85b5bf9.
1 parent 03cb994 commit cb01743

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/ChainRulesCore.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export frule, rrule
55
export wirtinger_conjugate, wirtinger_primal, differential
66
export @scalar_rule, @thunk
77
export extern, cast, store!
8-
export Wirtinger, Zero, One, Casted, DNE, Thunk, InplaceThunk
8+
export Wirtinger, Zero, One, Casted, DNE, Thunk, InplaceableThunk
99
export NO_FIELDS
1010

1111
include("differentials.jl")

src/differentials.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,33 +253,33 @@ Base.conj(x::AbstractThunk) = @thunk(conj(extern(x)))
253253
Base.show(io::IO, x::Thunk) = println(io, "Thunk($(repr(x.f)))")
254254

255255
"""
256-
InplaceThunk(val::Thunk, add!::Function)
256+
InplaceableThunk(val::Thunk, add!::Function)
257257
258258
A wrapper for a `Thunk`, that allows it to define an inplace `add!` function,
259-
which is used internally in `accumulate!(Δ, ::InplaceThunk)`.
259+
which is used internally in `accumulate!(Δ, ::InplaceableThunk)`.
260260
261261
`add!` should be defined such that: `ithunk.add!(Δ) = Δ .+= ithunk.val`
262262
but it should do this more efficently than simply doing this directly.
263263
(Otherwise one can just use a normal `Thunk`).
264264
265-
Most operations on an `InplaceThunk` treat it just like a normal `Thunk`;
265+
Most operations on an `InplaceableThunk` treat it just like a normal `Thunk`;
266266
and destroy its inplacability.
267267
"""
268-
struct InplaceThunk{T<:Thunk, F} <: AbstractThunk
268+
struct InplaceableThunk{T<:Thunk, F} <: AbstractThunk
269269
val::T
270270
add!::F
271271
end
272272

273-
(x::InplaceThunk)() = x.val()
274-
@inline extern(x::InplaceThunk) = extern(x.val)
273+
(x::InplaceableThunk)() = x.val()
274+
@inline extern(x::InplaceableThunk) = extern(x.val)
275275

276-
function Base.show(io::IO, x::InplaceThunk)
277-
println(io, "InplaceThunk($(repr(x.val)), $(repr(x.add!)))")
276+
function Base.show(io::IO, x::InplaceableThunk)
277+
println(io, "InplaceableThunk($(repr(x.val)), $(repr(x.add!)))")
278278
end
279279

280280
# The real reason we have this:
281-
accumulate!(Δ, ∂::InplaceThunk) =.add!(Δ)
282-
store!(Δ, ∂::InplaceThunk) =.add!((Δ.*=false)) # zero it, then add to it.
281+
accumulate!(Δ, ∂::InplaceableThunk) =.add!(Δ)
282+
store!(Δ, ∂::InplaceableThunk) =.add!((Δ.*=false)) # zero it, then add to it.
283283

284284
"""
285285
NO_FIELDS

0 commit comments

Comments
 (0)