Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
6beef85b
Unverified
Commit
6beef85b
authored
Dec 17, 2019
by
Zihao Ye
Committed by
GitHub
Dec 17, 2019
Browse files
upd (#1113)
parent
41114b87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
python/dgl/backend/numpy/tensor.py
python/dgl/backend/numpy/tensor.py
+8
-0
No files found.
python/dgl/backend/numpy/tensor.py
View file @
6beef85b
...
...
@@ -110,6 +110,14 @@ def argsort(input, dim, descending):
return
np
.
argsort
(
-
input
,
axis
=
dim
)
return
np
.
argsort
(
input
,
axis
=
dim
)
def
topk
(
input
,
k
,
dim
,
descending
=
True
):
topk_indices
=
argtopk
(
input
,
k
,
dim
,
descending
)
return
np
.
take_along_axis
(
input
,
topk_indices
,
axis
=
dim
)
def
argtopk
(
input
,
k
,
dim
,
descending
=
True
):
sort_indces
=
argsort
(
input
,
dim
,
descending
)
return
slice_axis
(
sort_indces
,
dim
,
0
,
k
)
def
exp
(
input
):
return
np
.
exp
(
input
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment