Skip to content

Commit 3258dee

Browse files
authored
Merge branch 'JuliaDiff:main' into kron
2 parents d5a8446 + ae37562 commit 3258dee

22 files changed

+197
-24
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style = "blue"

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- x86
2222
- x64
2323
steps:
24-
- uses: actions/checkout@v4.0.0
24+
- uses: actions/checkout@v4
2525
- uses: julia-actions/setup-julia@v1
2626
with:
2727
version: ${{ matrix.version }}

.github/workflows/Cancel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
cancel:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: styfle/cancel-workflow-action@0.9.0
16+
- uses: styfle/cancel-workflow-action@0.12.0
1717
with:
1818
all_but_latest: true
1919
workflow_id: ${{ github.event.workflow.id }}

.github/workflows/IntegrationTest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
# package: {user: JuliaDiff, repo: Diffractor.jl}
2626

2727
steps:
28-
- uses: actions/checkout@v4.0.0
28+
- uses: actions/checkout@v4
2929
- uses: julia-actions/setup-julia@v1
3030
with:
3131
version: ${{ matrix.julia-version }}
3232
arch: x64
3333
- uses: julia-actions/julia-buildpkg@latest
3434
- name: Clone Downstream
35-
uses: actions/checkout@v4.0.0
35+
uses: actions/checkout@v4
3636
with:
3737
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
3838
path: downstream

.github/workflows/JuliaNightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- x86
2424
- x64
2525
steps:
26-
- uses: actions/checkout@v4.0.0
26+
- uses: actions/checkout@v4
2727
- uses: julia-actions/setup-julia@v1
2828
with:
2929
version: ${{ matrix.version }}

.github/workflows/VersionVigilante_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
VersionVigilante:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4.0.0
9+
- uses: actions/checkout@v4
1010
- uses: julia-actions/setup-julia@latest
1111
- name: VersionVigilante.main
1212
id: versionvigilante_main

.github/workflows/format.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Format suggestions
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: only if it is a pull request build.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
11+
12+
jobs:
13+
format:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: julia-actions/setup-julia@latest
18+
with:
19+
version: 1
20+
- run: |
21+
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
22+
julia -e 'using JuliaFormatter; format("."; verbose=true)'
23+
- uses: reviewdog/action-suggester@v1
24+
with:
25+
tool_name: JuliaFormatter
26+
fail_on_error: true
27+
filter_mode: added

Project.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.54.0"
3+
version = "1.58.1"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -23,15 +23,21 @@ Adapt = "3.4.0"
2323
ChainRulesCore = "1.15.3"
2424
ChainRulesTestUtils = "1.5"
2525
Compat = "3.46, 4.2"
26+
Distributed = "1"
2627
FiniteDifferences = "0.12.20"
2728
GPUArraysCore = "0.1.0"
2829
IrrationalConstants = "0.1.1, 0.2"
2930
JLArrays = "0.1"
3031
JuliaInterpreter = "0.8,0.9"
32+
LinearAlgebra = "1"
33+
Random = "1"
3134
RealDot = "0.1"
3235
SparseInverseSubset = "0.1"
36+
SparseArrays = "1"
3337
StaticArrays = "1.2"
38+
Statistics = "1"
3439
StructArrays = "0.6.11"
40+
SuiteSparse = "1"
3541
julia = "1.6"
3642

3743
[extras]

src/ChainRules.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ include("rulesets/Base/indexing.jl")
4343
include("rulesets/Base/sort.jl")
4444
include("rulesets/Base/mapreduce.jl")
4545
include("rulesets/Base/broadcast.jl")
46+
include("rulesets/Base/CoreLogging.jl")
4647

4748
include("rulesets/Distributed/nondiff.jl")
4849

src/rulesets/Base/CoreLogging.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# For the CoreLogging submodule of Base. (not to be confused with the Logging stdlib)
2+
3+
function rrule(
4+
rc::RuleConfig{>:ChainRulesCore.HasReverseMode},
5+
::typeof(Base.CoreLogging.with_logger),
6+
f::Function,
7+
logger::Base.CoreLogging.AbstractLogger,
8+
)
9+
y, f_pb = Base.CoreLogging.with_logger(logger) do
10+
rrule_via_ad(rc, f)
11+
end
12+
with_logger_pullback(ȳ) = (NoTangent(), only(f_pb(ȳ)), NoTangent())
13+
return y, with_logger_pullback
14+
end
15+
16+
@non_differentiable Base.CoreLogging.current_logger(args...)
17+
@non_differentiable Base.CoreLogging.current_logger_for_env(::Any...)
18+
@non_differentiable Base.CoreLogging._invoked_shouldlog(::Any...)
19+
@non_differentiable Base.CoreLogging.Base.fixup_stdlib_path(::Any)
20+
@non_differentiable Base.CoreLogging.handle_message(::Any...)

0 commit comments

Comments
 (0)