This is an automated email from the ASF dual-hosted git repository.
ruihangl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 2345e6ea26 [Docs] Add API reference documentation for tvm.script
module (#19366)
2345e6ea26 is described below
commit 2345e6ea2665dcc681c78cdc2d2da650d87130c3
Author: Shushi Hong <[email protected]>
AuthorDate: Wed Apr 8 00:58:00 2026 -0400
[Docs] Add API reference documentation for tvm.script module (#19366)
Add API reference documentation for tvm.script module
---
docs/reference/api/python/index.rst | 9 +++++
docs/reference/api/python/script/ir_builder.rst | 46 +++++++++++++++++++++++++
docs/reference/api/python/script/parser.rst | 37 ++++++++++++++++++++
docs/reference/api/python/script/printer.rst | 25 ++++++++++++++
docs/reference/api/python/script/script.rst | 35 +++++++++++++++++++
python/tvm/script/ir_builder/ir/ir.py | 2 ++
6 files changed, 154 insertions(+)
diff --git a/docs/reference/api/python/index.rst
b/docs/reference/api/python/index.rst
index a3852e6ada..fa83956972 100644
--- a/docs/reference/api/python/index.rst
+++ b/docs/reference/api/python/index.rst
@@ -70,6 +70,15 @@ Python API
s_tir/transform
s_tir/dlight
+.. toctree::
+ :maxdepth: 1
+ :caption: tvm.script
+
+ script/script
+ script/parser
+ script/ir_builder
+ script/printer
+
.. toctree::
:maxdepth: 1
:caption: tvm.te
diff --git a/docs/reference/api/python/script/ir_builder.rst
b/docs/reference/api/python/script/ir_builder.rst
new file mode 100644
index 0000000000..201090a0e4
--- /dev/null
+++ b/docs/reference/api/python/script/ir_builder.rst
@@ -0,0 +1,46 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+.. http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+tvm.script.ir_builder
+---------------------
+
+tvm.script.ir_builder
+*********************
+.. automodule:: tvm.script.ir_builder
+ :members:
+ :imported-members:
+
+tvm.script.ir_builder.ir
+************************
+.. automodule:: tvm.script.ir_builder.ir
+ :members:
+ :imported-members:
+
+tvm.script.ir_builder.relax
+***************************
+.. automodule:: tvm.script.ir_builder.relax
+ :members:
+
+tvm.script.ir_builder.relax.distributed
+***************************************
+.. automodule:: tvm.script.ir_builder.relax.distributed
+ :members:
+
+tvm.script.ir_builder.tirx
+**************************
+.. automodule:: tvm.script.ir_builder.tirx
+ :members:
diff --git a/docs/reference/api/python/script/parser.rst
b/docs/reference/api/python/script/parser.rst
new file mode 100644
index 0000000000..583b27b276
--- /dev/null
+++ b/docs/reference/api/python/script/parser.rst
@@ -0,0 +1,37 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+.. http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+tvm.script.parser
+-----------------
+
+tvm.script.parser
+*****************
+.. automodule:: tvm.script.parser
+ :members:
+ :imported-members:
+
+tvm.script.parser.ir
+********************
+.. automodule:: tvm.script.parser.ir
+
+tvm.script.parser.relax
+***********************
+.. automodule:: tvm.script.parser.relax
+
+tvm.script.parser.tirx
+**********************
+.. automodule:: tvm.script.parser.tirx
diff --git a/docs/reference/api/python/script/printer.rst
b/docs/reference/api/python/script/printer.rst
new file mode 100644
index 0000000000..b5dddb4396
--- /dev/null
+++ b/docs/reference/api/python/script/printer.rst
@@ -0,0 +1,25 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+.. http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+tvm.script.printer
+------------------
+
+tvm.script.printer
+******************
+.. automodule:: tvm.script.printer
+ :members:
+ :imported-members:
diff --git a/docs/reference/api/python/script/script.rst
b/docs/reference/api/python/script/script.rst
new file mode 100644
index 0000000000..5e819bd1bb
--- /dev/null
+++ b/docs/reference/api/python/script/script.rst
@@ -0,0 +1,35 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+.. http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+tvm.script
+----------
+
+tvm.script
+**********
+.. automodule:: tvm.script
+ :members:
+ :imported-members:
+
+tvm.script.relax
+****************
+.. automodule:: tvm.script.relax
+ :members:
+
+tvm.script.tirx
+***************
+.. automodule:: tvm.script.tirx
+ :members:
diff --git a/python/tvm/script/ir_builder/ir/ir.py
b/python/tvm/script/ir_builder/ir/ir.py
index 12e31038fc..dba2063f03 100644
--- a/python/tvm/script/ir_builder/ir/ir.py
+++ b/python/tvm/script/ir_builder/ir/ir.py
@@ -35,6 +35,7 @@ def ir_module() -> IRModuleFrame:
def decl_function(func_name: str, func_signature: BaseFunc) -> GlobalVar:
"""Declare a Function without given the specific function implementation.
+
Parameters
----------
func_name : str
@@ -47,6 +48,7 @@ def decl_function(func_name: str, func_signature: BaseFunc)
-> GlobalVar:
Note
----
It is usually used in cross-function call. And we can specify the function
by `DefFunction`
+
Returns
-------
gv : GlobalVar