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
FAST-RNNT
Commits
5a8c1e3a
"tests/nn/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "4b5b4d3d373f9af9fd97dc9cf1b74ab3b4826d90"
Commit
5a8c1e3a
authored
Jun 30, 2021
by
Daniel Povey
Browse files
test with zeros working.
parent
12d3b03d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
torch_integrated_conv/integrated_conv.py
torch_integrated_conv/integrated_conv.py
+2
-2
torch_integrated_conv/integrated_conv_test.py
torch_integrated_conv/integrated_conv_test.py
+2
-1
No files found.
torch_integrated_conv/integrated_conv.py
View file @
5a8c1e3a
...
@@ -26,7 +26,7 @@ except ImportError:
...
@@ -26,7 +26,7 @@ except ImportError:
try
:
try
:
import
torch_integrated_conv_cuda
import
torch_integrated_conv_cuda
except
ImportError
:
except
ImportError
:
if
VERBOSE
:
if
VERBOSE
:
print
(
'Falling back to JIT compiling torch_integrated_conv_cuda'
)
print
(
'Falling back to JIT compiling torch_integrated_conv_cuda'
)
...
@@ -43,7 +43,7 @@ except ImportError:
...
@@ -43,7 +43,7 @@ except ImportError:
def
_integrated_conv_forward_dispather
(
input
:
torch
.
Tensor
,
def
_integrated_conv_forward_dispat
c
her
(
input
:
torch
.
Tensor
,
pos_add
:
torch
.
Tensor
,
pos_add
:
torch
.
Tensor
,
pos_mul
:
torch
.
Tensor
)
->
torch
.
Tensor
:
pos_mul
:
torch
.
Tensor
)
->
torch
.
Tensor
:
if
input
.
is_cuda
:
if
input
.
is_cuda
:
...
...
torch_integrated_conv/integrated_conv_test.py
View file @
5a8c1e3a
...
@@ -16,5 +16,6 @@ def test_integrated_conv_zeros():
...
@@ -16,5 +16,6 @@ def test_integrated_conv_zeros():
pos_add
=
torch
.
zeros
(
C
,
kH
,
kW
,
device
=
device
,
dtype
=
dtype
)
pos_add
=
torch
.
zeros
(
C
,
kH
,
kW
,
device
=
device
,
dtype
=
dtype
)
pos_mul
=
torch
.
zeros
(
C
,
kH
,
kW
,
device
=
device
,
dtype
=
dtype
)
pos_mul
=
torch
.
zeros
(
C
,
kH
,
kW
,
device
=
device
,
dtype
=
dtype
)
output_ref
=
torch
.
zeros
(
N
,
C
,
H
,
W
,
device
=
device
,
dtype
=
dtype
)
output
=
integrated_conv
(
input
,
pos_add
,
pos_mul
)
output
=
integrated_conv
(
input
,
pos_add
,
pos_mul
)
assert
torch
.
allclose
(
in
put
,
output
)
assert
torch
.
allclose
(
out
put
,
output
_ref
)
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