Skip to content

Commit 4d788f2

Browse files
committed
Fix
1 parent 6c1abb0 commit 4d788f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ function broadcast_edges(g::GNNGraph, x)
100100
return gather(x, gi)
101101
end
102102

103-
function _sort_row(matrix::AbstractArray; rev::Bool = true, sortby::Int = 1)
104-
index = sortperm(view(matrix, :, sortby); rev)
105-
return matrix[index, :]
103+
function _sort_col(matrix::AbstractArray; rev::Bool = true, sortby::Int = 1)
104+
index = sortperm(view(matrix, sortby, : ); rev)
105+
return matrix[ :, index]
106106
end
107107

108108
function _sort_matrix(matrix::AbstractArray, k::Int; rev::Bool = true, sortby = nothing)
109109
if sortby === nothing
110-
return sort(matrix, dims = 1; rev)[1:k, :]
110+
return sort(matrix, dims = 2; rev)[:, 1:k]
111111
else
112-
return _sort_row(matrix; rev, sortby)[1:k, :]
112+
return _sort_col(matrix; rev, sortby)[:, 1:k]
113113
end
114114
end
115115

0 commit comments

Comments
 (0)