Skip to content

Commit ff0725a

Browse files
committed
style: clean up naming
1 parent f1ceb88 commit ff0725a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/ChainRules.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
module ChainRulesModule
22

33
using ChainRulesCore:
4-
ChainRulesCore, AbstractTangent, NoTangent, ZeroTangent, Tangent, @thunk, canonicalize
4+
ChainRulesCore as CRC,
5+
AbstractTangent,
6+
NoTangent,
7+
ZeroTangent,
8+
Tangent,
9+
@thunk,
10+
canonicalize
511
using ..OperatorEnumModule: OperatorEnum
612
using ..NodeModule: AbstractExpressionNode, with_type_parameters, tree_mapreduce
713
using ..EvaluateModule: eval_tree_array
@@ -19,7 +25,7 @@ Base.:*(a::Number, b::NodeTangent) = NodeTangent(b.tree, a * b.gradient)
1925
Base.:*(a::NodeTangent, b::Number) = NodeTangent(a.tree, a.gradient * b)
2026
Base.zero(::Union{Type{NodeTangent},NodeTangent}) = ZeroTangent()
2127

22-
function ChainRulesCore.rrule(
28+
function CRC.rrule(
2329
::typeof(eval_tree_array),
2430
tree::AbstractExpressionNode,
2531
X::AbstractMatrix,

src/ParametricExpression.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ParametricExpressionModule
22

33
using DispatchDoctor: @stable, @unstable
4-
using ChainRulesCore: ChainRulesCore, NoTangent, @thunk
4+
using ChainRulesCore: ChainRulesCore as CRC, NoTangent, @thunk
55

66
using ..OperatorEnumModule: AbstractOperatorEnum, OperatorEnum
77
using ..NodeModule: AbstractExpressionNode, Node, tree_mapreduce
@@ -238,9 +238,7 @@ function Base.convert(::Type{Node}, ex::ParametricExpression{T}) where {T}
238238
Node{T},
239239
)
240240
end
241-
function ChainRulesCore.rrule(
242-
::typeof(convert), ::Type{Node}, ex::ParametricExpression{T}
243-
) where {T}
241+
function CRC.rrule(::typeof(convert), ::Type{Node}, ex::ParametricExpression{T}) where {T}
244242
tree = get_contents(ex)
245243
primal = convert(Node, ex)
246244
pullback = let tree = tree

0 commit comments

Comments
 (0)