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
0e0f739b
Commit
0e0f739b
authored
Jul 19, 2020
by
syiming
Browse files
force pad to multiple pad tensors of zero with same dtype of input
parent
26f976c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
research/object_detection/utils/ops.py
research/object_detection/utils/ops.py
+2
-2
No files found.
research/object_detection/utils/ops.py
View file @
0e0f739b
...
...
@@ -216,13 +216,13 @@ def pad_to_multiple(tensor, multiple):
height_pad
=
tf
.
zeros
([
batch_size
,
padded_tensor_height
-
tensor_height
,
tensor_width
,
tensor_depth
])
]
,
dtype
=
tensor
.
dtype
)
tensor
=
tf
.
concat
([
tensor
,
height_pad
],
1
)
if
padded_tensor_width
!=
tensor_width
:
width_pad
=
tf
.
zeros
([
batch_size
,
padded_tensor_height
,
padded_tensor_width
-
tensor_width
,
tensor_depth
])
]
,
dtype
=
tensor
.
dtype
)
tensor
=
tf
.
concat
([
tensor
,
width_pad
],
2
)
return
tensor
...
...
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