[fix] flake8 lint error (#34146)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34146
Test Plan:
.
Imported from OSS
Differential Revision: D20228830
fbshipit-source-id: 41de3c27c10256939ae6309d25b0499f708a3dca
diff --git a/test/test_jit.py b/test/test_jit.py
index 2cc64e3..e017cbd 100644
--- a/test/test_jit.py
+++ b/test/test_jit.py
@@ -1025,11 +1025,9 @@
qconfig_dict = {'': script_qconfig(default_qconfig)}
torch._C._jit_pass_insert_observers(m._c, "forward", qconfig_dict, True)
# for input and output of conv
- assert len(attrs_with_prefix(m, '_observer_')) == 2, \
- 'Expected to have 2 observer submodules'
+ assert len(attrs_with_prefix(m, '_observer_')) == 2
# for weight
- assert len(attrs_with_prefix(m.conv, '_observer_')) == 1, \
- 'Expected to have 1 observer submodules'
+ assert len(attrs_with_prefix(m.conv, '_observer_')) == 1
def test_insert_observers_child_qconfig(self):
class Sub(torch.nn.Module):
@@ -1059,17 +1057,13 @@
qconfig_dict,
True)
# input and output of sub
- assert len(attrs_with_prefix(m, '_observer_')) == 2, \
- 'Expected to have 2 observers'
+ assert len(attrs_with_prefix(m, '_observer_')) == 2
# not quantized
- assert len(attrs_with_prefix(m.conv, '_observer_')) == 0, \
- 'Expected to have 0 observers'
+ assert len(attrs_with_prefix(m.conv, '_observer_')) == 0
# no observers since we observe in the outer most call site
- assert len(attrs_with_prefix(m.sub, '_observer_')) == 0, \
- 'Expected to have 0 observers'
+ assert len(attrs_with_prefix(m.sub, '_observer_')) == 0
# weight of linear
- assert len(attrs_with_prefix(m.sub.fc, '_observer_')) == 1, \
- 'Expected to have 1 observers'
+ assert len(attrs_with_prefix(m.sub.fc, '_observer_')) == 1
@unittest.skip("we are changing this test in next PR")
def test_insert_observers_skip_values(self):