Skip to content

Commit

Permalink
[TIR] [Docs] Fix unsafe_set_dtype docstring (apache#14611)
Browse files Browse the repository at this point in the history
Looks like the `unsafe_set_dtype` docs  were not updated after the API was renamed during PR reviews, just fixing that.
  • Loading branch information
quic-sanirudh authored Apr 13, 2023
1 parent 815422c commit 9e5055b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tvm/tir/schedule/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2581,7 +2581,7 @@ def unsafe_set_dtype(self, block: Union[BlockRV, str], buffer_index: int, dtype:
Examples
--------
Before set_dtype, in TensorIR, the IR is:
Before unsafe_set_dtype, in TensorIR, the IR is:
.. code-block:: python
Expand All @@ -2600,12 +2600,12 @@ def before_set_dtype(
vi, vj = T.axis.remap("SS", [i, j]
C[vi, vj] = B[vi, vj] + 1.0
Create the schedule and do set_dtype:
Create the schedule and do unsafe_set_dtype:
.. code-block:: python
sch = tir.Schedule(before_set_dtype)
sch.set_dtype("B", buffer_index=0, dtype="float16")
sch.unsafe_set_dtype("B", buffer_index=0, dtype="float16")
print(sch.mod["main"].script())
After applying set_dtype, the IR becomes:
Expand All @@ -2629,7 +2629,8 @@ def after_set_dtype(
Note
----
`set_dtype` requires the buffer to be an intermediate buffer defined via `alloc_buffer`.
`unsafe_set_dtype` requires the buffer to be an intermediate buffer defined via
`alloc_buffer`.
"""
block = self._normalize_block_arg(block)
_ffi_api.ScheduleUnsafeSetDType( # type: ignore # pylint: disable=no-member
Expand Down

0 comments on commit 9e5055b

Please sign in to comment.