allenai / allenai/bi-att-flow

Problem: sum of class instances when downgrading to python 2.7

Offen
#51 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.5k
Forks
668
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi all, I'm trying to downgrade the code into python 2.7. I found in the customized evaluation class overloaded the add operation as: def __add__(self, other).

When sum over evaluation instances of different batches, it simply use a sum command:
def get_evaluation_from_batches(self, sess, batches):
e = sum(self.get_evaluation(sess, batch) for batch in batches)
The sum inherits the overloaded sum operation well in python 3.5 whereas it does not work in python 2.7.

Does any one meet the same problem and find some solutions? Any suggestion would be appreciated. Thanks!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.