Skip to content

Commit

Permalink
Fix: long division should perform floor division (changed behaviour p…
Browse files Browse the repository at this point in the history
…ytorch 3.7)
  • Loading branch information
wouterkool committed Nov 20, 2020
1 parent 6c5b78e commit c1d77bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nets/attention_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def propose_expansions(self, beam, fixed, expand_size=None, normalize=False, max
flat_feas = flat_score > -1e10 # != -math.inf triggers

# Parent is row idx of ind_topk, can be found by enumerating elements and dividing by number of columns
flat_parent = torch.arange(flat_action.size(-1), out=flat_action.new()) / ind_topk.size(-1)
flat_parent = torch.arange(flat_action.size(-1), out=flat_action.new()) // ind_topk.size(-1)

# Filter infeasible
feas_ind_2d = torch.nonzero(flat_feas)
Expand Down

0 comments on commit c1d77bd

Please sign in to comment.