-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Target py310 and modernize codebase with ruff #23401
Conversation
@@ -2661,7 +2661,7 @@ | |||
return attention_mask | |||
|
|||
|
|||
def test_gpt_model(args: argparse.Namespace, sentences: Optional[List[str]] = None, is_greedy: bool = False): | |||
def test_gpt_model(args: argparse.Namespace, sentences: list[str] | None = None, is_greedy: bool = False): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -3061,7 +3061,7 @@ | |||
return output | |||
|
|||
|
|||
def main(argv: Optional[List[str]] = None, sentences: Optional[List[str]] = None): | |||
def main(argv: list[str] | None = None, sentences: list[str] | None = None): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -29,7 +28,7 @@ | |||
if self.fuse_4(tanh_node, input_name_to_nodes, output_name_to_node): | |||
return | |||
|
|||
def fuse_1(self, tanh_node, input_name_to_nodes, output_name_to_node) -> Optional[bool]: | |||
def fuse_1(self, tanh_node, input_name_to_nodes, output_name_to_node) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -137,7 +136,7 @@ | |||
self.node_name_to_graph_name[fused_node.name] = self.this_graph_name | |||
return True | |||
|
|||
def fuse_2(self, tanh_node, input_name_to_nodes: Dict, output_name_to_node: Dict) -> Optional[bool]: | |||
def fuse_2(self, tanh_node, input_name_to_nodes: dict, output_name_to_node: dict) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -246,7 +245,7 @@ | |||
self.node_name_to_graph_name[fused_node.name] = self.this_graph_name | |||
return True | |||
|
|||
def fuse_3(self, tanh_node, input_name_to_nodes: Dict, output_name_to_node: Dict) -> Optional[bool]: | |||
def fuse_3(self, tanh_node, input_name_to_nodes: dict, output_name_to_node: dict) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
if self.fuse_1(erf_node, input_name_to_nodes, output_name_to_node): | ||
return | ||
if self.fuse_2(erf_node, input_name_to_nodes, output_name_to_node): | ||
return | ||
self.fuse_3(erf_node, input_name_to_nodes, output_name_to_node) | ||
|
||
def fuse_1(self, erf_node, input_name_to_nodes: Dict, output_name_to_node: Dict) -> Optional[bool]: | ||
def fuse_1(self, erf_node, input_name_to_nodes: dict, output_name_to_node: dict) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -107,7 +106,7 @@ | |||
self.increase_counter("Gelu") | |||
return True | |||
|
|||
def fuse_2(self, erf_node, input_name_to_nodes: Dict, output_name_to_node: Dict) -> Optional[bool]: | |||
def fuse_2(self, erf_node, input_name_to_nodes: dict, output_name_to_node: dict) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
@@ -184,7 +183,7 @@ | |||
self.increase_counter("Gelu") | |||
return True | |||
|
|||
def fuse_3(self, erf_node, input_name_to_nodes: Dict, output_name_to_node: Dict) -> Optional[bool]: | |||
def fuse_3(self, erf_node, input_name_to_nodes: dict, output_name_to_node: dict) -> bool | None: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
Change
target-version = "py310"
and modernize the code base with ruff.