Add a new statement to the DataflowBlock with an automatically generated variable name. Parameters ---------- expr : Expr The expression to add. name : Optional[str], optional Variable name, by default None is_dfvar : bool, op
(self, expr: Expr, name: str | None = None, is_dfvar: bool = False)
| 75 | return _ffi_api.dfb_rewrite_add_binding(self, binding) # type: ignore |
| 76 | |
| 77 | def add(self, expr: Expr, name: str | None = None, is_dfvar: bool = False) -> None: |
| 78 | """ |
| 79 | Add a new statement to the DataflowBlock with an automatically generated variable name. |
| 80 | |
| 81 | Parameters |
| 82 | ---------- |
| 83 | expr : Expr |
| 84 | The expression to add. |
| 85 | name : Optional[str], optional |
| 86 | Variable name, by default None |
| 87 | is_dfvar : bool, optional |
| 88 | The variable type, by default False |
| 89 | |
| 90 | Notes |
| 91 | ----- |
| 92 | If the variable name is not given, it will be automatically generated in a form of |
| 93 | "tmp${COUNTER}". The variable type will be DataflowVar if is_dfvar is True, otherwise |
| 94 | it will be Var. Being Var means the variables are output variables of the DataflowBlock. |
| 95 | While being DataflowVar means the variables are internal variables of the DataflowBlock. |
| 96 | """ |
| 97 | _ffi_api.dfb_rewrite_add(self, expr, name, is_dfvar) # type: ignore |
| 98 | |
| 99 | def remove_unused(self, var: Var, allow_undef=False) -> None: |
| 100 | """ |
no outgoing calls