gemini-code-assist[bot] commented on code in PR #18689:
URL: https://github.com/apache/tvm/pull/18689#discussion_r2732969058
##########
python/tvm/tir/analysis/analysis.py:
##########
@@ -298,7 +298,7 @@ def find_anchor_block(mod: IRModule) -> Block:
anchor_block: Block
Review Comment:

The type hint in the docstring should be updated to `SBlock` to match the
function's return type annotation.
```suggestion
anchor_block: SBlock
```
##########
python/tvm/dlight/analysis/common_analysis.py:
##########
@@ -257,23 +258,23 @@ def is_data_pad(self, sch: tir.Schedule) -> bool:
)
def is_convolution(self) -> bool:
- """Whether a Block can be considered having Convolution Pattern"""
+ """Whether a SBlock can be considered having Convolution Pattern"""
raise NotImplementedError
def is_pool(self) -> bool:
- """Whether a Block can be considered having Pooling Pattern"""
+ """Whether a SBlock can be considered having Pooling Pattern"""
raise NotImplementedError
def is_gemv(self) -> bool:
- """Whether the block is a GEMV workload."""
+ """Whether the SBlock is a GEMV workload."""
raise NotImplementedError
def is_gemm(self) -> bool:
"""Whether the block is a GEMM workload."""
Review Comment:

For consistency with other docstrings in this class, this should refer to
`SBlock`.
```suggestion
"""Whether the SBlock is a GEMM workload."""
```
##########
python/tvm/tir/functor.py:
##########
@@ -521,20 +521,20 @@ def visit_evaluate_(self, op: Evaluate) -> None:
print("visit_evaluate_", op)
_ffi_api.PyStmtExprVisitorDefaultVisitStmt(self._outer(), op) # type:
ignore
- def visit_block_(self, op: Block) -> None:
+ def visit_sblock_(self, op: SBlock) -> None:
"""Visit Block.
Users can customize this function to overwrite VisitStmt_(const
BlockNode* op)
on the C++ side.
Parameters
----------
op : Block
- The Block to be visited.
+ The SBlock to be visited.
"""
Review Comment:

The docstring for `visit_sblock_` should be updated to refer to `SBlock` and
`SBlockNode` for consistency.
```suggestion
"""Visit SBlock.
Users can customize this function to overwrite VisitStmt_(const
SBlockNode* op)
on the C++ side.
Parameters
----------
op : SBlock
The SBlock to be visited.
"""
```
##########
python/tvm/tir/schedule/schedule.py:
##########
@@ -480,7 +482,7 @@ def sample_compute_location(
########## Schedule: Get blocks & loops ##########
@type_checked
- def get_block(self, name: str, func_name: Optional[str] = None) -> BlockRV:
+ def get_block(self, name: str, func_name: Optional[str] = None) ->
SBlockRV:
Review Comment:

For consistency with the C++ API change from `GetBlock` to `GetSBlock`, it
would be clearer to rename this Python method to `get_sblock` as well. While
keeping `get_block` might be for backward compatibility, it could be confusing
since `tir.Block` is now `tir.SBlock`.
```suggestion
def get_sblock(self, name: str, func_name: Optional[str] = None) ->
SBlockRV:
```
##########
python/tvm/tir/functor.py:
##########
@@ -1421,15 +1421,15 @@ def visit_evaluate_(self, op: Evaluate) -> Stmt:
"""
return _ffi_api.PyStmtExprMutatorDefaultVisitStmt(self._outer(), op)
# type: ignore
- def visit_block_(self, op: Block) -> Stmt:
- """Visit Block.
+ def visit_sblock_(self, op: SBlock) -> Stmt:
+ """Visit SBlock.
Users can customize this function to overwrite VisitStmt_(const
BlockNode* op)
on the C++ side.
Review Comment:

The C++ node name in the docstring should be updated to `SBlockNode`.
```suggestion
Users can customize this function to overwrite VisitStmt_(const
SBlockNode* op)
on the C++ side.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]