|
| 1 | +# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, |
| 10 | +# software distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import pytest |
| 16 | + |
| 17 | +from sparsezoo.models.classification import efficientnet_b0, efficientnet_b4 |
| 18 | +from tests.sparsezoo.utils import model_constructor |
| 19 | + |
| 20 | + |
| 21 | +@pytest.mark.parametrize( |
| 22 | + ( |
| 23 | + "download,framework,repo,dataset,training_scheme," |
| 24 | + "optim_name,optim_category,optim_target" |
| 25 | + ), |
| 26 | + [ |
| 27 | + (True, "pytorch", "sparseml", "imagenet", None, "base", "none", None), |
| 28 | + (True, "pytorch", "sparseml", "imagenet", None, "arch", "moderate", None), |
| 29 | + ], |
| 30 | +) |
| 31 | +def test_efficientnet_b0( |
| 32 | + download, |
| 33 | + framework, |
| 34 | + repo, |
| 35 | + dataset, |
| 36 | + training_scheme, |
| 37 | + optim_name, |
| 38 | + optim_category, |
| 39 | + optim_target, |
| 40 | +): |
| 41 | + model_constructor( |
| 42 | + efficientnet_b0, |
| 43 | + download, |
| 44 | + framework, |
| 45 | + repo, |
| 46 | + dataset, |
| 47 | + training_scheme, |
| 48 | + optim_name, |
| 49 | + optim_category, |
| 50 | + optim_target, |
| 51 | + ) |
| 52 | + |
| 53 | + |
| 54 | +@pytest.mark.parametrize( |
| 55 | + ( |
| 56 | + "download,framework,repo,dataset,training_scheme," |
| 57 | + "optim_name,optim_category,optim_target" |
| 58 | + ), |
| 59 | + [ |
| 60 | + (True, "pytorch", "sparseml", "imagenet", None, "base", "none", None), |
| 61 | + (True, "pytorch", "sparseml", "imagenet", None, "arch", "moderate", None), |
| 62 | + ], |
| 63 | +) |
| 64 | +def test_efficientnet_b4( |
| 65 | + download, |
| 66 | + framework, |
| 67 | + repo, |
| 68 | + dataset, |
| 69 | + training_scheme, |
| 70 | + optim_name, |
| 71 | + optim_category, |
| 72 | + optim_target, |
| 73 | +): |
| 74 | + model_constructor( |
| 75 | + efficientnet_b4, |
| 76 | + download, |
| 77 | + framework, |
| 78 | + repo, |
| 79 | + dataset, |
| 80 | + training_scheme, |
| 81 | + optim_name, |
| 82 | + optim_category, |
| 83 | + optim_target, |
| 84 | + ) |
0 commit comments