Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
accumulate(Δ, ∂)

Return `Δ + ∂` evaluated in a manner that supports ChainRulesCore's
various `AbstractDifferential` types.
various [`AbstractDifferential`](@ref) types.

See also: [`accumulate!`](@ref), [`store!`](@ref), [`AbstractRule`](@ref)
See also: [`accumulate!`](@ref), [`store!`](@ref)
"""
accumulate(Δ, ∂) = Δ .+ ∂

Expand All @@ -16,8 +16,9 @@ accumulate(Δ, ∂) = Δ .+ ∂
Similar to [`accumulate`](@ref), but attempts to compute `Δ + rule(args...)` in-place,
storing the result in `Δ`.

Note: this function may not actually store the result in `Δ` if `Δ` is immutable,
so it is best to always call this as `Δ = accumulate!(Δ, ∂)` just in-case.
!!! note
This function may not actually store the result in `Δ` if `Δ` is immutable,
so it is best to always call this as `Δ = accumulate!(Δ, ∂)` just in case.

This function is overloadable by using a [`InplaceThunk`](@ref).
See also: [`accumulate`](@ref), [`store!`](@ref).
Expand All @@ -37,6 +38,6 @@ necessary for alternative approaches (e.g. `copyto!(Δ, extern(∂))`)
Like [`accumulate`](@ref) and [`accumulate!`](@ref), this function is intended
to be customizable for specific rules/input types.

See also: [`accumulate`](@ref), [`accumulate!`](@ref), [`AbstractRule`](@ref)
See also: [`accumulate`](@ref), [`accumulate!`](@ref)
"""
store!(Δ, ∂) = materialize!(Δ, broadcastable(∂))
4 changes: 2 additions & 2 deletions src/rule_definition_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ is equivalent to:
(∂f₂_∂x₁, ∂f₂_∂x₂, ...),
...)

For examples, see ChainRulesCore' `rules` directory.
For examples, see ChainRules' `rulesets` directory.

See also: [`frule`](@ref), [`rrule`](@ref), [`AbstractRule`](@ref)
See also: [`frule`](@ref), [`rrule`](@ref).
"""
macro scalar_rule(call, maybe_setup, partials...)
call, setup_stmts, inputs, partials = _normalize_scalarrules_macro_input(
Expand Down