Skip to content

Commit 2510d49

Browse files
authored
Remove More Dead Code (#220)
* Bump patch * Remove more dead code
1 parent f31a495 commit 2510d49

File tree

6 files changed

+29
-55
lines changed

6 files changed

+29
-55
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Stheno"
22
uuid = "8188c328-b5d6-583d-959b-9690869a5511"
3-
version = "0.7.17"
3+
version = "0.7.18"
44

55
[deps]
66
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"

src/Stheno.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module Stheno
3535
# Various bits of utility that aren't inherently GP-related. Often very type-piratic.
3636
include(joinpath("util", "zygote_rules.jl"))
3737
include(joinpath("util", "covariance_matrices.jl"))
38-
include(joinpath("util", "dense.jl"))
38+
include(joinpath("util", "block_arrays.jl"))
3939
include(joinpath("util", "abstract_data_set.jl"))
4040
include(joinpath("util", "proper_type_piracy.jl"))
4141

src/util/block_arrays.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file contains a number of additions to BlockArrays.jl. These are completely
2+
# independent of Stheno.jl, and will (hopefully) move over to BlockArrays.jl at some point.
3+
4+
function ChainRulesCore.rrule(::typeof(BlockArrays.mortar), _blocks::AbstractArray)
5+
y = BlockArrays.mortar(_blocks)
6+
Ty = typeof(y)
7+
function mortar_pullback::Tangent)
8+
return (NoTangent(), Δ.blocks)
9+
end
10+
function mortar_pullback::BlockArray)
11+
return mortar_pullback(Tangent{Ty}(; blocks = Δ.blocks, axes=NoTangent()))
12+
end
13+
return y, mortar_pullback
14+
end
15+
16+
# A hook to which I can attach an rrule without commiting type-piracy against BlockArrays.
17+
_collect(X::BlockArray) = Array(X)
18+
19+
function ChainRulesCore.rrule(::typeof(_collect), X::BlockArray)
20+
function Array_pullback::Array)
21+
ΔX = Tangent{Any}(blocks=BlockArray(Δ, axes(X)).blocks, axes=NoTangent())
22+
return (NoTangent(), ΔX)
23+
end
24+
return Array(X), Array_pullback
25+
end

src/util/dense.jl

Lines changed: 0 additions & 50 deletions
This file was deleted.

test/runtests.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ using Stheno:
3434
diag_At_A,
3535
diag_At_B,
3636
diag_Xt_invA_X,
37-
diag_Xt_invA_Y,
38-
blocksizes
37+
diag_Xt_invA_Y
3938

4039
using Stheno.AbstractGPs.TestUtils: test_internal_abstractgps_interface
4140
using Stheno.AbstractGPs.Distributions: MvNormal
@@ -55,7 +54,7 @@ include("test_util.jl")
5554
@timedtestset "util" begin
5655
include(joinpath("util", "zygote_rules.jl"))
5756
include(joinpath("util", "covariance_matrices.jl"))
58-
include(joinpath("util", "dense.jl"))
57+
include(joinpath("util", "block_arrays.jl"))
5958
include(joinpath("util", "abstract_data_set.jl"))
6059
end
6160

File renamed without changes.

0 commit comments

Comments
 (0)