masahi commented on a change in pull request #9721:
URL: https://github.com/apache/tvm/pull/9721#discussion_r768112083
##########
File path: src/relay/transforms/partition_graph.cc
##########
@@ -601,9 +607,10 @@ Pass PartitionGraph(String mod_name) {
{flatten_tuples_pass, remove_default_pass, partition_pass,
name_mangling_pass, InferType()});
}
-TVM_REGISTER_GLOBAL("relay._transform.PartitionGraph").set_body_typed([](String
mod_name) {
- return transform::PartitionGraph(mod_name);
-});
+TVM_REGISTER_GLOBAL("relay._transform.PartitionGraph")
+ .set_body_typed([](String mod_name, bool bind_constants = false) {
Review comment:
You are right, it seems removing `bind_constants` from `return
_ffi_api.PartitionGraph(mod_name, bind_constants)` results in the error:
``` File
"/home/masa/projects/dev/tvm/python/tvm/relay/transform/transform.py", line
721, in PartitionGraph
return _ffi_api.PartitionGraph(mod_name)
File "/home/masa/projects/dev/tvm/python/tvm/_ffi/_ctypes/packed_func.py",
line 237, in __call__
raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
1: TVMFuncCall
0: std::_Function_handler<void (tvm::runtime::TVMArgs,
tvm::runtime::TVMRetValue*), tvm::runtime::TypedPackedFunc<tvm::transform::Pass
(tvm::runtime::String,
bool)>::AssignTypedLambda<tvm::relay::transform::{lambda(tvm::runtime::String,
bool)#1}>(tvm::relay::transform::{lambda(tvm::runtime::String, bool)#1},
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>)::{lambda(tvm::runtime::TVMArgs const&,
tvm::runtime::TVMRetValue*)#1}>::_M_invoke(std::_Any_data const&,
tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&)
File "/home/masa/projects/dev/tvm/include/tvm/runtime/packed_func.h", line
1477
TVMError: Function relay._transform.PartitionGraph expects 2 arguments, but
1 were provided.
```
Removed the default value.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]