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
288c1cff
Commit
288c1cff
authored
Aug 25, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 392931060
parent
0b098c60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
official/nlp/data/squad_lib_sp.py
official/nlp/data/squad_lib_sp.py
+1
-1
official/nlp/projects/triviaqa/inputs.py
official/nlp/projects/triviaqa/inputs.py
+5
-5
No files found.
official/nlp/data/squad_lib_sp.py
View file @
288c1cff
...
...
@@ -175,7 +175,7 @@ def _convert_index(index, pos, m=None, is_start=True):
front
-=
1
assert
index
[
front
]
is
not
None
or
index
[
rear
]
is
not
None
if
index
[
front
]
is
None
:
if
index
[
rear
]
>=
1
:
if
index
[
rear
]
>=
1
:
# pytype: disable=unsupported-operands
if
is_start
:
return
0
else
:
...
...
official/nlp/projects/triviaqa/inputs.py
View file @
288c1cff
...
...
@@ -48,15 +48,15 @@ def _flatten_dims(tensor: tf.Tensor,
rank
=
tensor
.
shape
.
rank
if
rank
is
None
:
raise
ValueError
(
'Static rank of `tensor` must be known.'
)
if
first_dim
<
0
:
if
first_dim
<
0
:
# pytype: disable=unsupported-operands
first_dim
+=
rank
if
first_dim
<
0
or
first_dim
>=
rank
:
if
first_dim
<
0
or
first_dim
>=
rank
:
# pytype: disable=unsupported-operands
raise
ValueError
(
'`first_dim` out of bounds for `tensor` rank.'
)
if
last_dim
<
0
:
if
last_dim
<
0
:
# pytype: disable=unsupported-operands
last_dim
+=
rank
if
last_dim
<
0
or
last_dim
>=
rank
:
if
last_dim
<
0
or
last_dim
>=
rank
:
# pytype: disable=unsupported-operands
raise
ValueError
(
'`last_dim` out of bounds for `tensor` rank.'
)
if
first_dim
>
last_dim
:
if
first_dim
>
last_dim
:
# pytype: disable=unsupported-operands
raise
ValueError
(
'`first_dim` must not be larger than `last_dim`.'
)
# Try to calculate static flattened dim size if all input sizes to flatten
...
...
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