File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -100,16 +100,16 @@ function broadcast_edges(g::GNNGraph, x)
100
100
return gather (x, gi)
101
101
end
102
102
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 ]
106
106
end
107
107
108
108
function _sort_matrix (matrix:: AbstractArray , k:: Int ; rev:: Bool = true , sortby = nothing )
109
109
if sortby === nothing
110
- return sort (matrix, dims = 1 ; rev)[1 : k, : ]
110
+ return sort (matrix, dims = 2 ; rev)[:, 1 : k ]
111
111
else
112
- return _sort_row (matrix; rev, sortby)[1 : k, : ]
112
+ return _sort_col (matrix; rev, sortby)[:, 1 : k ]
113
113
end
114
114
end
115
115
You can’t perform that action at this time.
0 commit comments