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
c923d629
Commit
c923d629
authored
Aug 16, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Aug 16, 2020
Browse files
Internal change
PiperOrigin-RevId: 326947209
parent
3ea89d24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
official/nlp/modeling/ops/beam_search.py
official/nlp/modeling/ops/beam_search.py
+2
-6
No files found.
official/nlp/modeling/ops/beam_search.py
View file @
c923d629
...
...
@@ -457,7 +457,8 @@ class SequenceBeamSearch(tf.Module):
_StateKeys
.
ALIVE_LOG_PROBS
:
tf
.
TensorShape
([
batch_size
,
self
.
beam_size
]),
_StateKeys
.
ALIVE_CACHE
:
tf
.
nest
.
map_structure
(
_get_shape
,
alive_cache
),
tf
.
nest
.
map_structure
(
lambda
state
:
state
.
get_shape
(),
alive_cache
),
_StateKeys
.
FINISHED_SEQ
:
tf
.
TensorShape
(
[
batch_size
,
self
.
beam_size
,
self
.
max_decode_length
+
1
]),
...
...
@@ -629,11 +630,6 @@ def _get_shape_keep_last_dim(tensor):
return
tf
.
TensorShape
(
shape_list
)
def
_get_shape
(
tensor
):
"""Return the shape of the input tensor."""
return
tf
.
TensorShape
(
_shape_list
(
tensor
))
def
_flatten_beam_dim
(
tensor
):
"""Reshapes first two dimensions in to single dimension.
...
...
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