Update optimize_pipeline.py to use __name__ detection (#15866)

### Description
<!-- Describe your changes. -->

Use `__name__` detection in `optimize_pipeline.py`.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

It prevents unwanted execution of `main` when importing the file.
This commit is contained in:
Chester Liu 2023-05-13 11:43:29 +08:00 committed by GitHub
parent 9328a0f955
commit 984dd02df3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,4 +312,5 @@ def main():
)
main()
if __name__ == "__main__":
main()