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
2cd62f6c
Commit
2cd62f6c
authored
Jan 13, 2017
by
Chris Shallue
Committed by
GitHub
Jan 13, 2017
Browse files
Merge pull request #842 from tae-jun/patch-1
im2txt: make python3 compatible adding lt and eq
parents
513998a3
c0997f44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
im2txt/im2txt/inference_utils/caption_generator.py
im2txt/im2txt/inference_utils/caption_generator.py
+10
-0
No files found.
im2txt/im2txt/inference_utils/caption_generator.py
View file @
2cd62f6c
...
...
@@ -54,6 +54,16 @@ class Caption(object):
return
-
1
else
:
return
1
# For Python 3 compatibility (__cmp__ is deprecated).
def
__lt__
(
self
,
other
):
assert
isinstance
(
other
,
Caption
)
return
self
.
score
<
other
.
score
# Also for Python 3 compatibility.
def
__eq__
(
self
,
other
):
assert
isinstance
(
other
,
Caption
)
return
self
.
score
==
other
.
score
class
TopN
(
object
):
...
...
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