zhiics commented on a change in pull request #5324: [Runtime][Relay][Cleanup]
Clean up for memory pass to enable heterogenous execution support.
URL: https://github.com/apache/incubator-tvm/pull/5324#discussion_r407796226
##########
File path: python/tvm/relay/op/memory/memory.py
##########
@@ -96,3 +100,53 @@ def shape_func(func, inputs, outputs, dependent=False):
The shape function expression.
"""
return _make.shape_func(func, inputs, outputs, dependent)
+
+def flatten_tuple_type(ty):
+ """Return a sequence of the types contained in the tuple type in order.
+
+ Parameters
+ ----------
+ ty: tvm.Type
+ The type to flatten.
+
+ Returns
+ -------
+ result: List[tvm.Type]
+ The types in their linear order.
+ """
+ return _make.FlattenTupleType(ty)
+
+def from_tuple_type(ty, expr):
+ """Convert an expression with the given type into a sequence of
expressions.
+ Each expressions maps to a field of the tuple or nested tuples in linear
Review comment:
```suggestion
Each expression maps to a field of the tuple or nested tuples in
linear
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services