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

[CRC][No.35] add docstring for Builtin/UDGenerator #315

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions sot/opcode_translator/executor/variables/callable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down Expand Up @@ -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
):
Expand Down