Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix flake8 E262 and type hints (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Oct 11, 2023
1 parent d967681 commit 44d8049
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sot/symbolic/statement_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

import weakref
from typing import Callable
from typing import Any, Callable

import paddle
from paddle.utils import is_sequence, map_structure
Expand Down Expand Up @@ -251,7 +251,8 @@ class SIRRuntimeCache:
"""

def __init__(self):
self.cache = {} # { name : (inputs, outputs, free_vars) }
self.cache = {}
# { name : (inputs, outputs, free_vars) }
# inputs : can be used when call_SIR, if free_vars exist
# outputs : used for generator new ProxyTensor output before fallback
# free_vars: (name, function)
Expand All @@ -265,7 +266,7 @@ def has_key(self, key: str) -> bool:
"""
return key in self.cache.keys()

def set_origin_inputs(self, key: str, inputs: any):
def set_origin_inputs(self, key: str, inputs: Any):
"""
Set Cache origin Inputs of the StatementIR
"""
Expand All @@ -275,7 +276,7 @@ def set_origin_inputs(self, key: str, inputs: any):
else:
self.cache[key] = (inputs, None, None)

def set_origin_outputs(self, key: str, outputs: any):
def set_origin_outputs(self, key: str, outputs: Any):
"""
Set Cache origin outputs of the StatementIR
"""
Expand All @@ -285,7 +286,7 @@ def set_origin_outputs(self, key: str, outputs: any):
else:
self.cache[key] = (None, outputs, None)

def set_free_vars(self, key: str, free_vars: any):
def set_free_vars(self, key: str, free_vars: Any):
"""
Set Cache free variables of the StatementIR
"""
Expand Down

0 comments on commit 44d8049

Please sign in to comment.