| 410 | return network_results |
| 411 | |
| 412 | def add_args(self, parser) -> argparse.ArgumentParser: |
| 413 | super().add_args(parser) |
| 414 | trt_group = parser.add_argument_group("trt") |
| 415 | trt_group.add_argument( |
| 416 | "--disable-preview-dynamic-shapes", |
| 417 | help="Disable the FASTER_DYNAMIC_SHAPES_0805 preview feature when building the TensorRT engine", |
| 418 | action="store_true", |
| 419 | ) |
| 420 | |
| 421 | trt_benchmarking_group = parser.add_argument_group("trt benchmarking group") |
| 422 | trt_benchmarking_group.add_argument( |
| 423 | "--input-profile-max-len", |
| 424 | type=int, |
| 425 | help="Specify max input sequence length in TRT engine profile. (default: max supported sequence length)", |
| 426 | ) |
| 427 | trt_benchmarking_group.add_argument( |
| 428 | "--output-profile-max-len", |
| 429 | type=int, |
| 430 | help="Specify max output sequence length in TRT engine profile. (default: max supported sequence length)", |
| 431 | ) |
| 432 | |
| 433 | def args_to_network_metadata(self, args) -> NetworkMetadata: |
| 434 | return self.config.MetadataClass.from_inference_args(args) |