Skip to content

Commit 0da2158

Browse files
committed
Undo formatting noise
1 parent 7e79b17 commit 0da2158

3 files changed

Lines changed: 28 additions & 16 deletions

File tree

DifferentiationInterface/ext/DifferentiationInterfaceGTPSAExt/onearg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function DI.pushforward(
4646
DI.check_prep(f, prep, backend, x, tx, contexts...)
4747
fc = DI.fix_tail(f, map(DI.unwrap, contexts)...)
4848
ty = map(tx) do dx
49-
foreach((t, xi, dxi) -> (t[0]=xi; t[1]=dxi), prep.xt, x, dx)
49+
foreach((t, xi, dxi) -> (t[0] = xi; t[1] = dxi), prep.xt, x, dx)
5050
yt = fc(prep.xt)
5151
if yt isa Number
5252
return yt[1]
@@ -71,7 +71,7 @@ function DI.pushforward!(
7171
fc = DI.fix_tail(f, map(DI.unwrap, contexts)...)
7272
for b in eachindex(tx, ty)
7373
dx, dy = tx[b], ty[b]
74-
foreach((t, xi, dxi) -> (t[0]=xi; t[1]=dxi), prep.xt, x, dx)
74+
foreach((t, xi, dxi) -> (t[0] = xi; t[1] = dxi), prep.xt, x, dx)
7575
yt = fc(prep.xt)
7676
map!(t -> t[1], dy, yt)
7777
end

DifferentiationInterface/ext/DifferentiationInterfaceGTPSAExt/twoarg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function DI.pushforward(
5656
DI.check_prep(f!, y, prep, backend, x, tx, contexts...)
5757
fc! = DI.fix_tail(f!, map(DI.unwrap, contexts)...)
5858
ty = map(tx) do dx
59-
foreach((t, xi, dxi) -> (t[0]=xi; t[1]=dxi), prep.xt, x, dx)
59+
foreach((t, xi, dxi) -> (t[0] = xi; t[1] = dxi), prep.xt, x, dx)
6060
fc!(prep.yt, prep.xt)
6161
dy = map(t -> t[1], prep.yt)
6262
return dy
@@ -79,7 +79,7 @@ function DI.pushforward!(
7979
fc! = DI.fix_tail(f!, map(DI.unwrap, contexts)...)
8080
for b in eachindex(tx, ty)
8181
dx, dy = tx[b], ty[b]
82-
foreach((t, xi, dxi) -> (t[0]=xi; t[1]=dxi), prep.xt, x, dx)
82+
foreach((t, xi, dxi) -> (t[0] = xi; t[1] = dxi), prep.xt, x, dx)
8383
fc!(prep.yt, prep.xt)
8484
map!(t -> t[1], dy, prep.yt)
8585
end

DifferentiationInterfaceTest/src/tests/correctness_eval.jl

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ for op in ALL_OPS
5656
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
5757
local prepstrict
5858
preptup_cands_val, preptup_cands_noval = map(1:2) do _
59-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
59+
new_smaller =
60+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
6061
deepcopy(scen)
6162
else
6263
deepcopy(smaller)
@@ -123,7 +124,8 @@ for op in ALL_OPS
123124
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
124125
local prepstrict
125126
preptup_cands_val, preptup_cands_noval = map(1:2) do _
126-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
127+
new_smaller =
128+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
127129
deepcopy(scen)
128130
else
129131
deepcopy(smaller)
@@ -206,7 +208,8 @@ for op in ALL_OPS
206208
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
207209
local prepstrict
208210
preptup_cands_val, preptup_cands_noval = map(1:2) do _
209-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
211+
new_smaller =
212+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
210213
deepcopy(scen)
211214
else
212215
deepcopy(smaller)
@@ -283,7 +286,8 @@ for op in ALL_OPS
283286
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
284287
local prepstrict
285288
preptup_cands_val, preptup_cands_noval = map(1:2) do _
286-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
289+
new_smaller =
290+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
287291
deepcopy(scen)
288292
else
289293
deepcopy(smaller)
@@ -371,7 +375,8 @@ for op in ALL_OPS
371375
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
372376
local prepstrict
373377
preptup_cands_val, preptup_cands_noval = map(1:2) do _
374-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
378+
new_smaller =
379+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
375380
deepcopy(scen)
376381
else
377382
deepcopy(smaller)
@@ -440,7 +445,8 @@ for op in ALL_OPS
440445
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
441446
local prepstrict
442447
preptup_cands_val, preptup_cands_noval = map(1:2) do _
443-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
448+
new_smaller =
449+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
444450
deepcopy(scen)
445451
else
446452
deepcopy(smaller)
@@ -526,7 +532,8 @@ for op in ALL_OPS
526532
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
527533
local prepstrict
528534
preptup_cands_val, preptup_cands_noval = map(1:2) do _
529-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
535+
new_smaller =
536+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
530537
deepcopy(scen)
531538
else
532539
deepcopy(smaller)
@@ -592,7 +599,8 @@ for op in ALL_OPS
592599
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
593600
local prepstrict
594601
preptup_cands_val, preptup_cands_noval = map(1:2) do _
595-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
602+
new_smaller =
603+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
596604
deepcopy(scen)
597605
else
598606
deepcopy(smaller)
@@ -674,7 +682,8 @@ for op in ALL_OPS
674682
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
675683
local prepstrict
676684
preptup_cands_val, preptup_cands_noval = map(1:2) do _
677-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
685+
new_smaller =
686+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
678687
deepcopy(scen)
679688
else
680689
deepcopy(smaller)
@@ -756,7 +765,8 @@ for op in ALL_OPS
756765
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
757766
local prepstrict
758767
preptup_cands_val, preptup_cands_noval = map(1:2) do _
759-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
768+
new_smaller =
769+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
760770
deepcopy(scen)
761771
else
762772
deepcopy(smaller)
@@ -857,7 +867,8 @@ for op in ALL_OPS
857867
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
858868
local prepstrict
859869
preptup_cands_val, preptup_cands_noval = map(1:2) do _
860-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
870+
new_smaller =
871+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
861872
deepcopy(scen)
862873
else
863874
deepcopy(smaller)
@@ -923,7 +934,8 @@ for op in ALL_OPS
923934
contextsrand = rewrap(map(myrandom unwrap, contexts)...)
924935
local prepstrict
925936
preptup_cands_val, preptup_cands_noval = map(1:2) do _
926-
new_smaller = if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
937+
new_smaller =
938+
if isnothing(smaller) || adapt_batchsize(ba, smaller) != ba
927939
deepcopy(scen)
928940
else
929941
deepcopy(smaller)

0 commit comments

Comments
 (0)