Skip to content

Commit

Permalink
add changelog and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
DuYicong515 committed Mar 5, 2022
1 parent 318c0f5 commit 0e2b576
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed to avoid common hook warning if no hook is overridden ([#12131](https://github.com/PyTorchLightning/pytorch-lightning/pull/12131))


- Fixed an issue that metric states are incorretly saved and restored on checkpointing when `_fault_tolerant_training() = False` ([#12236](https://github.com/PyTorchLightning/pytorch-lightning/pull/12236))


## [1.5.10] - 2022-02-08

### Fixed
Expand Down
7 changes: 5 additions & 2 deletions tests/callbacks/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import pytest
import torch
from torchmetrics import Metric
from torchmetrics.functional import mean_absolute_percentage_error as mape

from pytorch_lightning import seed_everything, Trainer
Expand Down Expand Up @@ -243,5 +244,7 @@ def test_quantization_val_test_predict(tmpdir):

expected_state_dict = expected_qmodel.state_dict()
for key, value in val_test_predict_qmodel.state_dict().items():
expected_value = expected_state_dict[key]
assert torch.allclose(value, expected_value)
# validate and test will affect metric module state, other modules should be comparable.
if not isinstance(val_test_predict_qmodel.get_submodule(key.split(".")[0]), Metric):
expected_value = expected_state_dict[key]
assert torch.allclose(value, expected_value)

0 comments on commit 0e2b576

Please sign in to comment.