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
ModelZoo
ResNet50_tensorflow
Commits
0cb7e02d
Unverified
Commit
0cb7e02d
authored
Jun 07, 2018
by
Katherine Wu
Committed by
GitHub
Jun 07, 2018
Browse files
Change unittest tf test (#4485)
parent
26f50b58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
official/transformer/compute_bleu_test.py
official/transformer/compute_bleu_test.py
+2
-3
official/transformer/utils/tokenizer_test.py
official/transformer/utils/tokenizer_test.py
+3
-4
No files found.
official/transformer/compute_bleu_test.py
View file @
0cb7e02d
...
...
@@ -15,14 +15,13 @@
"""Test functions in compute_blue.py."""
import
tempfile
import
unittest
import
tensorflow
as
tf
# pylint: disable=g-bad-import-order
from
official.transformer
import
compute_bleu
class
ComputeBleuTest
(
unit
test
.
TestCase
):
class
ComputeBleuTest
(
tf
.
test
.
TestCase
):
def
_create_temp_file
(
self
,
text
):
temp_file
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
...
...
@@ -62,4 +61,4 @@ class ComputeBleuTest(unittest.TestCase):
if
__name__
==
"__main__"
:
unit
test
.
main
()
tf
.
test
.
main
()
official/transformer/utils/tokenizer_test.py
View file @
0cb7e02d
...
...
@@ -16,14 +16,13 @@
import
collections
import
tempfile
import
unittest
import
tensorflow
as
tf
# pylint: disable=g-bad-import-order
from
official.transformer.utils
import
tokenizer
class
SubtokenizerTest
(
unit
test
.
TestCase
):
class
SubtokenizerTest
(
tf
.
test
.
TestCase
):
def
_init_subtokenizer
(
self
,
vocab_list
):
temp_file
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
...
...
@@ -55,7 +54,7 @@ class SubtokenizerTest(unittest.TestCase):
self
.
assertEqual
([
u
"testing"
,
u
"123"
],
token_list
)
class
StringHelperTest
(
unit
test
.
TestCase
):
class
StringHelperTest
(
tf
.
test
.
TestCase
):
def
test_split_string_to_tokens
(
self
):
text
=
"test? testing 123."
...
...
@@ -180,4 +179,4 @@ class StringHelperTest(unittest.TestCase):
if
__name__
==
"__main__"
:
unit
test
.
main
()
tf
.
test
.
main
()
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