From d7af2e37c88aa0dede171b7ddc5ae5393e6744d2 Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 14 Mar 2022 16:20:02 -0500 Subject: [PATCH] [TIR] Updated python docstring and parameter names for AllocateConst (#10602) The previous docstring referred to the non-existent `data` parameter, and passed the argument named `condition` in Python as the parameter `data_or_idx` in C++. This commit matches the Python names and documentation to those in C++. --- python/tvm/tir/stmt.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/tvm/tir/stmt.py b/python/tvm/tir/stmt.py index 39831459f344..9734f7ae2bc9 100644 --- a/python/tvm/tir/stmt.py +++ b/python/tvm/tir/stmt.py @@ -349,17 +349,17 @@ class AllocateConst(Stmt): buffer_var : Var The buffer variable. - data : NDarray - The data associated with the constant - dtype : str The data type of the buffer. extents : list of Expr The extents of the allocate - condition : PrimExpr - The condition. + data_or_idx : Union[NDArray, int] + If an NDArray, this is the const data associated with the + constant. If an integer, this is the index into the + "Constants" attribute of the `IRModule` that contains the + `AllocateConst`. body : Stmt The body statement. @@ -368,9 +368,9 @@ class AllocateConst(Stmt): The location of this itervar in the source code. """ - def __init__(self, buffer_var, dtype, extents, condition, body, span=None): + def __init__(self, buffer_var, dtype, extents, data_or_idx, body, span=None): self.__init_handle_by_constructor__( - _ffi_api.AllocateConst, buffer_var, dtype, extents, condition, body, span + _ffi_api.AllocateConst, buffer_var, dtype, extents, data_or_idx, body, span )