diff --git a/sot/opcode_translator/executor/variables/callable.py b/sot/opcode_translator/executor/variables/callable.py index c0fd442da..06d65cbdf 100644 --- a/sot/opcode_translator/executor/variables/callable.py +++ b/sot/opcode_translator/executor/variables/callable.py @@ -401,6 +401,14 @@ def main_info(self) -> dict[str, Any]: class BuiltinVariable(FunctionVariable): + """ + BuiltinVariable is a subclass of FunctionVariable used to wrap a built-in function. + Args: + fn (Callable[..., Any]): The built-in function to be wrapped. + graph(FunctionGraph): The FunctionGraph object that this variable is associated with. + tracker(Tracker): The Tracker object that tracks the information of this variable. + """ + def __init__( self, fn: Callable[..., Any], graph: FunctionGraph, tracker: Tracker ): @@ -455,6 +463,14 @@ def main_info(self) -> dict[str, Any]: class UserDefinedGeneratorVariable(FunctionVariable): + """ + UserDefinedGeneratorVariable is a subclass of FunctionVariable used to wrap a user-defined generator. + Args: + fn (Callable[..., Any]): The user-defined generator to be wrapped. + graph(FunctionGraph): The FunctionGraph object that this variable is associated with. + tracker(Tracker): The Tracker object that tracks the information of this variable. + """ + def __init__( self, fn: Callable[..., Any], graph: FunctionGraph, tracker: Tracker ):