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
1d3cd3cf
Commit
1d3cd3cf
authored
Dec 03, 2019
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Dec 03, 2019
Browse files
Internal change
PiperOrigin-RevId: 283622345
parent
b478430d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
official/transformer/model/beam_search.py
official/transformer/model/beam_search.py
+3
-1
No files found.
official/transformer/model/beam_search.py
View file @
1d3cd3cf
...
...
@@ -402,7 +402,9 @@ class SequenceBeamSearch(object):
topk_ids
=
topk_indices
%
self
.
vocab_size
if
self
.
padded_decode
:
topk_seq
=
tf
.
transpose
(
topk_seq
,
perm
=
[
2
,
0
,
1
])
topk_seq
=
tf
.
tensor_scatter_nd_update
(
topk_seq
,
[
i
+
1
],
topk_ids
)
# TODO(b/145533236, hongkuny): Reverts once TF fix the validation.
topk_seq
=
tf
.
tensor_scatter_nd_update
(
topk_seq
,
[[
i
+
1
]],
tf
.
expand_dims
(
topk_ids
,
axis
=
0
))
topk_seq
=
tf
.
transpose
(
topk_seq
,
perm
=
[
1
,
2
,
0
])
else
:
topk_ids
=
tf
.
expand_dims
(
topk_ids
,
axis
=
2
)
...
...
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