From 145250b2618bb3b773f66b40d43638b737a2a11c Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:11:57 -0400 Subject: [PATCH 1/2] Update array.jl --- src/rulesets/Base/array.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rulesets/Base/array.jl b/src/rulesets/Base/array.jl index 7e4098509..d1a9d14c9 100644 --- a/src/rulesets/Base/array.jl +++ b/src/rulesets/Base/array.jl @@ -220,6 +220,11 @@ end # All the [hv]cat functions treat anything that's not an array as a scalar. _catsize(x) = () _catsize(x::AbstractArray) = size(x) +_catsize(::LinearAlgebra.UniformScaling) = error( + """ChainRules does not at present support *cat functions with LinearAlgebra.I + as it does not know how to calculate the size occupied in e.g. `[1:4 I 5:8]`. + Writing instead `[1:4 I(4) 5:8]` should work. + Issue tracking this is here: https://github.com/JuliaDiff/ChainRules.jl/issues/810""") function rrule(::typeof(hcat), Xs...) Y = hcat(Xs...) # note that Y always has 1-based indexing, even if X isa OffsetArray From ba0800c7328c3f4b20dc9a5942e7e2604ab44fd5 Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:17:41 -0400 Subject: [PATCH 2/2] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5c3a5607e..16cb9c879 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ChainRules" uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" -version = "1.71.0" +version = "1.71.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"