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
torch-scatter
Commits
1c4ef780
Commit
1c4ef780
authored
Dec 17, 2017
by
rusty1s
Browse files
added max min functions
parent
fa305127
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
torch_scatter/functions/__init__.py
torch_scatter/functions/__init__.py
+24
-1
No files found.
torch_scatter/functions/__init__.py
View file @
1c4ef780
...
@@ -61,8 +61,31 @@ def scatter_mean(index, input, dim=0, max_index=None, fill_value=0):
...
@@ -61,8 +61,31 @@ def scatter_mean(index, input, dim=0, max_index=None, fill_value=0):
return
scatter_mean_
(
output
,
index
,
input
,
dim
)
return
scatter_mean_
(
output
,
index
,
input
,
dim
)
def
scatter_max_
(
output
,
index
,
input
,
dim
=
0
):
output_index
=
index
.
new
(
output
.
size
()).
fill_
(
-
1
)
scatter
(
'max'
,
dim
,
output
,
index
,
input
,
output_index
)
return
output
,
output_index
def
scatter_max
(
index
,
input
,
dim
=
0
,
max_index
=
None
,
fill_value
=
0
):
output
=
gen_output
(
index
,
input
,
dim
,
max_index
,
fill_value
)
return
scatter_max_
(
output
,
index
,
input
,
dim
)
def
scatter_min_
(
output
,
index
,
input
,
dim
=
0
):
output_index
=
index
.
new
(
output
.
size
()).
fill_
(
-
1
)
scatter
(
'min'
,
dim
,
output
,
index
,
input
,
output_index
)
return
output
,
output_index
def
scatter_min
(
index
,
input
,
dim
=
0
,
max_index
=
None
,
fill_value
=
0
):
output
=
gen_output
(
index
,
input
,
dim
,
max_index
,
fill_value
)
return
scatter_min_
(
output
,
index
,
input
,
dim
)
__all__
=
[
__all__
=
[
'scatter_add_'
,
'scatter_add'
,
'scatter_sub_'
,
'scatter_sub'
,
'scatter_add_'
,
'scatter_add'
,
'scatter_sub_'
,
'scatter_sub'
,
'scatter_mul_'
,
'scatter_mul'
,
'scatter_div_'
,
'scatter_div'
,
'scatter_mul_'
,
'scatter_mul'
,
'scatter_div_'
,
'scatter_div'
,
'scatter_mean_'
,
'scatter_mean'
'scatter_mean_'
,
'scatter_mean'
,
'scatter_max_'
,
'scatter_max'
,
'scatter_min_'
,
'scatter_min'
]
]
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