()
| 144 | |
| 145 | |
| 146 | def main() -> None: # noqa: C901 |
| 147 | logger = logging.getLogger("") |
| 148 | logger.setLevel(logging.INFO) |
| 149 | |
| 150 | parser = argparse.ArgumentParser() |
| 151 | parser.add_argument( |
| 152 | "-m", |
| 153 | "--model_name", |
| 154 | required=True, |
| 155 | help=f"provide a model name. Valid ones: {list(MODEL_NAME_TO_MODEL.keys())}", |
| 156 | ) |
| 157 | |
| 158 | parser.add_argument( |
| 159 | "-fp16", |
| 160 | "--force_fp16", |
| 161 | action=argparse.BooleanOptionalAction, |
| 162 | default=False, |
| 163 | help="Force fp32 tensors to be converted to fp16 internally. Input/s outputs " |
| 164 | "will be converted to/from fp32 when entering/exiting the delegate. Default is " |
| 165 | "False", |
| 166 | ) |
| 167 | |
| 168 | parser.add_argument( |
| 169 | "--small_texture_limits", |
| 170 | action=argparse.BooleanOptionalAction, |
| 171 | default=False, |
| 172 | help="sets the default texture limit to be (2048, 2048, 2048) which is " |
| 173 | "compatible with more devices (i.e. desktop/laptop GPUs) compared to the " |
| 174 | "default (16384, 16384, 2048) which is more targeted for mobile GPUs. Default " |
| 175 | "is False.", |
| 176 | ) |
| 177 | |
| 178 | parser.add_argument( |
| 179 | "--skip_memory_planning", |
| 180 | action=argparse.BooleanOptionalAction, |
| 181 | default=False, |
| 182 | help="Skips memory planning pass while lowering, which can be used for " |
| 183 | "debugging. Default is False.", |
| 184 | ) |
| 185 | |
| 186 | parser.add_argument( |
| 187 | "-s", |
| 188 | "--strict", |
| 189 | action=argparse.BooleanOptionalAction, |
| 190 | default=True, |
| 191 | help="whether to export with strict mode. Default is True", |
| 192 | ) |
| 193 | |
| 194 | parser.add_argument( |
| 195 | "-d", |
| 196 | "--dynamic", |
| 197 | action=argparse.BooleanOptionalAction, |
| 198 | default=False, |
| 199 | help="Enable dynamic shape support. Default is False", |
| 200 | ) |
| 201 | |
| 202 | parser.add_argument( |
| 203 | "-r", |
no test coverage detected