mmsegmentation/tests/test_utils/test_make_divisible.py
yamengxi 25d8d77fab [New model] Support MobileNetV3 (#268)
* delete markdownlint

* Support MobileNetV3

* fix import

* add mobilenetv3 head and configs

* Modify MobileNetV3 to semantic segmentation version

* modify mobilenetv3 configs

* add std configs

* fix Conv2dAdaptivePadding bug

* add configs

* add unitest and fix bugs

* fix lraspp unitest bugs

* restore

* fix unitest

* add MobileNetV3 docstring

* add mmcv

* add mmcv

* fix syntax bug

* fix unitest bug

* fix unitest bug

* fix unitest bugs

* fix docstring

* add configs

* restore

* delete unnecessary assert

* modify unitest

* delete benchmark
2020-12-26 00:02:50 -08:00

14 lines
376 B
Python

from mmseg.models.utils import make_divisible
def test_make_divisible():
# test with min_value = None
assert make_divisible(10, 4) == 12
assert make_divisible(9, 4) == 12
assert make_divisible(1, 4) == 4
# test with min_value = 8
assert make_divisible(10, 4, 8) == 12
assert make_divisible(9, 4, 8) == 12
assert make_divisible(1, 4, 8) == 8