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
8ec6d0c6
Commit
8ec6d0c6
authored
Aug 07, 2020
by
rusty1s
Browse files
convert size to a list
parent
6a2cc2e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
torch_scatter/scatter.py
torch_scatter/scatter.py
+9
-9
No files found.
torch_scatter/scatter.py
View file @
8ec6d0c6
...
@@ -11,7 +11,7 @@ def scatter_sum(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
...
@@ -11,7 +11,7 @@ def scatter_sum(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
dim_size
:
Optional
[
int
]
=
None
)
->
torch
.
Tensor
:
dim_size
:
Optional
[
int
]
=
None
)
->
torch
.
Tensor
:
index
=
broadcast
(
index
,
src
,
dim
)
index
=
broadcast
(
index
,
src
,
dim
)
if
out
is
None
:
if
out
is
None
:
size
=
src
.
size
()
size
=
list
(
src
.
size
()
)
if
dim_size
is
not
None
:
if
dim_size
is
not
None
:
size
[
dim
]
=
dim_size
size
[
dim
]
=
dim_size
elif
index
.
numel
()
==
0
:
elif
index
.
numel
()
==
0
:
...
@@ -57,18 +57,18 @@ def scatter_mean(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
...
@@ -57,18 +57,18 @@ def scatter_mean(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
@
torch
.
jit
.
script
@
torch
.
jit
.
script
def
scatter_min
(
src
:
torch
.
Tensor
,
index
:
torch
.
Tensor
,
dim
:
int
=
-
1
,
def
scatter_min
(
out
:
Optional
[
torch
.
Tensor
]
=
None
,
src
:
torch
.
Tensor
,
index
:
torch
.
Tensor
,
dim
:
int
=
-
1
,
dim_size
:
Optional
[
int
]
=
None
out
:
Optional
[
torch
.
Tensor
]
=
None
,
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
dim_size
:
Optional
[
int
]
=
None
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
return
torch
.
ops
.
torch_scatter
.
scatter_min
(
src
,
index
,
dim
,
out
,
dim_size
)
return
torch
.
ops
.
torch_scatter
.
scatter_min
(
src
,
index
,
dim
,
out
,
dim_size
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
def
scatter_max
(
src
:
torch
.
Tensor
,
index
:
torch
.
Tensor
,
dim
:
int
=
-
1
,
def
scatter_max
(
out
:
Optional
[
torch
.
Tensor
]
=
None
,
src
:
torch
.
Tensor
,
index
:
torch
.
Tensor
,
dim
:
int
=
-
1
,
dim_size
:
Optional
[
int
]
=
None
out
:
Optional
[
torch
.
Tensor
]
=
None
,
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
dim_size
:
Optional
[
int
]
=
None
)
->
Tuple
[
torch
.
Tensor
,
torch
.
Tensor
]:
return
torch
.
ops
.
torch_scatter
.
scatter_max
(
src
,
index
,
dim
,
out
,
dim_size
)
return
torch
.
ops
.
torch_scatter
.
scatter_max
(
src
,
index
,
dim
,
out
,
dim_size
)
...
...
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