Skip to content

Commit

Permalink
Adding additional sanity check
Browse files Browse the repository at this point in the history
Signed-off-by: Priyanka Dangi <quic_pdangi@quicinc.com>
  • Loading branch information
quic-pdangi committed Oct 28, 2024
1 parent 09f2333 commit 285f5a9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ def batch_norm_wrapper(
momentum: float = 0.1,
eps: float = 1e-5,
) -> Tensor:
if training:
if self.input_quantizers[1] is not None or self.input_quantizers[2] is not None:
raise RuntimeError(f"{self.__class__} doesn't support quantizing running_mean or running_var in training mode")

input = _quantize_if_applicable(input, self.input_quantizers[0])
running_mean = _quantize_if_applicable(running_mean, self.input_quantizers[1])
Expand Down

0 comments on commit 285f5a9

Please sign in to comment.