Skip to content

Commit a53fd27

Browse files
workaround for sort ambiguity in cat_features (#105)
* fix sort ambiguity issue with empty tuple * bump version
1 parent 364c57e commit a53fd27

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GraphNeuralNetworks"
22
uuid = "cffab07f-9bc2-4db1-8861-388f63bf7694"
33
authors = ["Carlo Lucibello and contributors"]
4-
version = "0.3.8"
4+
version = "0.3.9"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -46,9 +46,11 @@ julia = "1.6"
4646
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
4747
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
4848
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
49+
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
4950
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
5051
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5152
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5253

5354
[targets]
54-
test = ["Test", "Adapt", "Zygote", "FiniteDifferences", "ChainRulesTestUtils", "MLDatasets"]
55+
test = ["Test", "Adapt", "InlineStrings", "Zygote", "FiniteDifferences",
56+
"ChainRulesTestUtils", "MLDatasets"]

src/GNNGraphs/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ cat_features(x1::AbstractArray, x2::AbstractArray) = cat(x1, x2, dims=ndims(x1))
1818
cat_features(x1::Union{Number, AbstractVector}, x2::Union{Number, AbstractVector}) =
1919
cat(x1, x2, dims=1)
2020

21+
# workaround for issue #98 #104
22+
cat_features(x1::NamedTuple{(), Tuple{}}, x2::NamedTuple{(), Tuple{}}) = (;)
23+
2124
function cat_features(x1::NamedTuple, x2::NamedTuple)
2225
sort(collect(keys(x1))) == sort(collect(keys(x2))) || @error "cannot concatenate feature data with different keys"
2326

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ using Graphs
1212
using Zygote
1313
using Test
1414
using MLDatasets
15+
using InlineStrings # not used but with the import we test #98 and #104
16+
1517
CUDA.allowscalar(false)
1618

1719
const ACUMatrix{T} = Union{CuMatrix{T}, CUDA.CUSPARSE.CuSparseMatrix{T}}

0 commit comments

Comments
 (0)