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
FastFold
Commits
6a41c3e7
Commit
6a41c3e7
authored
Dec 08, 2022
by
zhuww
Browse files
add scatter param
parent
16401cf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fastfold/distributed/comm.py
fastfold/distributed/comm.py
+2
-2
No files found.
fastfold/distributed/comm.py
View file @
6a41c3e7
...
@@ -136,11 +136,11 @@ class Copy(torch.autograd.Function):
...
@@ -136,11 +136,11 @@ class Copy(torch.autograd.Function):
return
_reduce
(
grad_output
)
return
_reduce
(
grad_output
)
def
scatter
(
input
:
Tensor
,
dim
:
int
=
-
1
)
->
Tensor
:
def
scatter
(
input
:
Tensor
,
dim
:
int
=
-
1
,
drop_unused
=
False
)
->
Tensor
:
if
torch
.
is_grad_enabled
()
and
input
.
requires_grad
:
if
torch
.
is_grad_enabled
()
and
input
.
requires_grad
:
input
=
Scatter
.
apply
(
input
,
dim
)
input
=
Scatter
.
apply
(
input
,
dim
)
else
:
else
:
input
=
_split
(
input
,
dim
=
dim
)
input
=
_split
(
input
,
dim
=
dim
,
drop_unused
=
drop_unused
)
return
input
return
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