pytorch-image-models/models
cclauss 51f85702a7
Identity is not the same thing as equality in Python
Identity is not the same thing as equality in Python.  In these instances, we want the latter.

Use ==/!= to compare str, bytes, and int literals.

$ __python__
```python
>>> proj = "pro"
>>> proj += 'j'
>>> proj
'proj'
>>> proj == 'proj'
True
>>> proj is 'proj'
False
>>> 0 == 0.0
True
>>> 0 is 0.0
False
```
[flake8](http://flake8.pycqa.org) testing of https://github.com/rwightman/pytorch-image-models on Python 3.7.1

$ __flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics__
```
./data/loader.py:48:23: F823 local variable 'input' defined as a builtin referenced before assignment
                yield input, target
                      ^
./models/dpn.py:170:12: F632 use ==/!= to compare str, bytes, and int literals
        if block_type is 'proj':
           ^
./models/dpn.py:173:14: F632 use ==/!= to compare str, bytes, and int literals
        elif block_type is 'down':
             ^
./models/dpn.py:177:20: F632 use ==/!= to compare str, bytes, and int literals
            assert block_type is 'normal'
                   ^
3     F632 use ==/!= to compare str, bytes, and int literals
1     F823 local variable 'input' defined as a builtin referenced before assignment
4
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2019-05-14 17:19:57 +02:00
..
__init__.py
adaptive_avgmax_pool.py Fix pooling in mnasnet, more sensible default for AMP opt level 2019-04-17 18:06:37 -07:00
conv2d_same.py Add support for tflite mnasnet pretrained weights and included spnasnet pretrained weights of my own. 2019-04-28 17:45:07 -07:00
densenet.py
dpn.py Identity is not the same thing as equality in Python 2019-05-14 17:19:57 +02:00
genmobilenet.py Fix efficient head for MobileNetV3 2019-05-11 11:23:11 -07:00
helpers.py
inception_resnet_v2.py
inception_v4.py
median_pool.py
model_factory.py Add MobileNetV3 and associated changes hard-swish, hard-sigmoid, efficient head, etc 2019-05-10 23:28:13 -07:00
pnasnet.py
resnet.py Add checkpoint clean script, add link to pretrained resnext50 weights 2019-04-13 14:15:35 -07:00
senet.py Add seresnet26_32x4d cfg and weights + interpolation str->PIL enum fn 2019-04-14 13:43:46 -07:00
test_time_pool.py
xception.py