1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

free unncessary memory in TokenizedText

This commit is contained in:
Jin Yong Yoo
2020-05-24 09:24:37 -04:00
parent 9152ba8d82
commit a793bd8aa3
5 changed files with 28 additions and 17 deletions

View File

@@ -141,7 +141,6 @@ class GeneticAlgorithm(SearchMethod):
for idx, result in enumerate(pop_results):
pop[idx].result = pop_results[idx]
pop = sorted(pop, key=lambda x: -x.result.score)
#print('\t\t', i, ' -- ', float(pop[0].result.score))
pop_scores = torch.Tensor([r.score for r in pop_results])
logits = ((-pop_scores) / self.temp).exp()