Commit 2cd62f6c authored by Chris Shallue's avatar Chris Shallue Committed by GitHub
Browse files

Merge pull request #842 from tae-jun/patch-1

im2txt: make python3 compatible adding lt and eq
parents 513998a3 c0997f44
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment