"torchvision/vscode:/vscode.git/clone" did not exist on "2091365544bf8bfef9c899b4981e889d8462c345"
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
......@@ -55,6 +55,16 @@ class Caption(object):
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):
"""Maintains the top n elements of an incrementally provided set."""
......
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