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
ad77aed9
Commit
ad77aed9
authored
Feb 22, 2021
by
Isha Arkatkar
Committed by
A. Unique TensorFlower
Feb 22, 2021
Browse files
Internal change
PiperOrigin-RevId: 358944046
parent
82f93573
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
official/nlp/transformer/translate.py
official/nlp/transformer/translate.py
+2
-8
No files found.
official/nlp/transformer/translate.py
View file @
ad77aed9
...
...
@@ -151,14 +151,8 @@ def translate_file(model,
text
=
distribution_strategy
.
run
(
text_as_per_replica
)
outputs
=
distribution_strategy
.
experimental_local_results
(
predict_step
(
text
))
tags
,
unordered_val_outputs
=
outputs
[
0
]
tags
=
[
tag
.
numpy
()
for
tag
in
tags
.
_values
]
unordered_val_outputs
=
[
val_output
.
numpy
()
for
val_output
in
unordered_val_outputs
.
_values
]
# pylint: enable=protected-access
val_outputs
=
[
None
]
*
len
(
tags
)
for
k
in
range
(
len
(
tags
)):
val_outputs
[
tags
[
k
]]
=
unordered_val_outputs
[
k
]
val_outputs
=
[
output
for
_
,
output
in
outputs
]
val_outputs
=
np
.
reshape
(
val_outputs
,
[
params
[
"decode_batch_size"
],
-
1
])
else
:
val_outputs
,
_
=
model
.
predict
(
text
)
...
...
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