Skip to content

fix: annotate script() #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Dec 9, 2022

Stack from ghstack (oldest at bottom):

To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped [misc]"

To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped  [misc]"

[ghstack-poisoned]
justinchuby added a commit that referenced this pull request Dec 9, 2022
To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped  [misc]"

ghstack-source-id: 02f281c
Pull Request resolved: #245
@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Merging #245 (8dc6b44) into gh/justinchuby/9/base (854c0de) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                  Coverage Diff                   @@
##           gh/justinchuby/9/base     #245   +/-   ##
======================================================
  Coverage                  71.50%   71.50%           
======================================================
  Files                         93       93           
  Lines                       8832     8833    +1     
======================================================
+ Hits                        6315     6316    +1     
  Misses                      2517     2517           
Impacted Files Coverage Δ
onnxscript/main.py 83.92% <100.00%> (+0.29%) ⬆️
...t/function_libs/torch_aten/ops_correctness_test.py 93.33% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -52,7 +53,9 @@ def script_check(f: ast.FunctionDef, opset, global_names, source, default_opset=
return convert.top_level_stmt(f)


def script(opset=None, default_opset=None, **kwargs):
def script(
opset: Optional[values.Opset] = None, default_opset: Optional[Any] = None, **kwargs: Any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Optional[values.Opset] for default_opset too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped  [misc]"

[ghstack-poisoned]
@justinchuby justinchuby added the change base before merge Remember to change the merge base to main when the PR is ready to merge label Dec 10, 2022
To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped  [misc]"

[ghstack-poisoned]
To allow mypy to analyze typing for annotated functions. Otherwise it complains that "Untyped decorator makes function "ones_like" untyped  [misc]"

[ghstack-poisoned]
@justinchuby justinchuby deleted the gh/justinchuby/9/head branch April 8, 2023 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change base before merge Remember to change the merge base to main when the PR is ready to merge topic: typing Typing related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants