Skip to content

Commit

Permalink
Fix DeferredBatchNorm mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
sublee committed Jun 7, 2019
1 parent bf51a06 commit 6a0a4d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions stubs/torch/nn/modules/batchnorm.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ class _BatchNorm(Module):
running_var: Tensor
num_batches_tracked: Tensor

# for DeferredBatchNorm
sum: Tensor
sum_squares: Tensor
counter: Tensor

def __init__(self,
num_features: int,
eps: float = 1e-5,
Expand Down
2 changes: 1 addition & 1 deletion torchgpipe/batchnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _track(self, input: Tensor) -> bool:
self.sum += input.sum(dim)
self.sum_squares += (input**2).sum(dim)

size = input.size().numel() / input.size(1)
size = input.size().numel() // input.size(1)
self.counter += size
self.tracked += 1

Expand Down

0 comments on commit 6a0a4d0

Please sign in to comment.