Skip to content

Commit

Permalink
Fix PyTorch floor division warning
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Lang <steven.lang.mz@gmail.com>
  • Loading branch information
braun-steven committed Nov 24, 2021
1 parent c0f7004 commit e63521d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions einet.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ def sample(
# Obtain repetition indices
ctx.repetition_indices = (ctx.parent_indices % self.config.R).squeeze(1)
# Shift indices
ctx.parent_indices = ctx.parent_indices // self.config.R
# ctx.parent_indices = ctx.parent_indices % num_roots
# ctx.parent_indices = ctx.parent_indices // self.config.R
ctx.parent_indices = torch.div(ctx.parent_indices, self.config.R, rounding_mode="floor")

# Now each sample in `indices` belongs to one repetition, index in `repetition_indices`

Expand Down

0 comments on commit e63521d

Please sign in to comment.