Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/tvm/relax/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
StaticPlanBlockMemory,
ToMixedPrecision,
ToNonDataflow,
TopologicalSort,
UpdateParamStructInfo,
UpdateVDevice,
VMBuiltinLower,
Expand Down
23 changes: 23 additions & 0 deletions python/tvm/relax/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,29 @@ def ToNonDataflow() -> tvm.ir.transform.Pass:
return _ffi_api.ToNonDataflow() # type: ignore


def TopologicalSort(order="depth-first", direction="from-inputs") -> tvm.ir.transform.Pass:
"""Sort bindings in relax.Dataflow blocks in the order specified

Parameters
----------
order: str

The order in which bindings should be emitted. Allowed values
are "depth-first" and "breadth-first".

direciton: str

The direction in which the sort should be performed. Allowed
values are "from-inputs" and "from-outputs".

Returns
-------
ret: tvm.ir.transform.Pass

"""
return _ffi_api.TopologicalSort(order, direction) # type: ignore


def RemovePurityChecking() -> tvm.ir.transform.Pass:
"""Activate relax.force_pure on all pure functions in the module
and unwrap all pure override ops into the normal versions.
Expand Down
Loading