Skip to content

Commit

Permalink
Update opgen for it to be runnable (#1922)
Browse files Browse the repository at this point in the history
Previously the opgen module assumes that it is installed as a package
and can be found at script import. Since we are now just running it as a
standalone script, I updated to imports so that it can be run directly.
Added a README.
  • Loading branch information
justinchuby authored Oct 30, 2024
1 parent 8438326 commit efe3073
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
17 changes: 17 additions & 0 deletions opgen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generator for onnx_opset

Use this module the generate onnx_opset implementations when new opsets are introduced with new ONNX versions.

## Generate

```sh
python opgen
```

Run

```sh
python opgen -h
```

for more information.
2 changes: 1 addition & 1 deletion opgen/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import textwrap
from pathlib import Path

from opgen.onnx_opset_builder import (
from onnx_opset_builder import (
OpsetId,
OpsetsBuilder,
format_opsetid,
Expand Down
3 changes: 1 addition & 2 deletions opgen/onnx_opset_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from textwrap import dedent
from typing import Annotated, Any, Iterable, Optional, Set, TextIO

import pygen as cg
from onnx.defs import (
AttributeProto,
OpSchema,
Expand All @@ -17,8 +18,6 @@
)
from onnx.helper import get_attribute_value

import opgen.pygen as cg

__all__ = [
"OpsetId",
"parse_opsetid",
Expand Down

0 comments on commit efe3073

Please sign in to comment.