Setting the CPU affinity and number of cores locally without RPC Remote

According to this post:

I tried to create a function in “module” (python/runtime/module.py) that hooks c++ into python so that I can directly use

module.module.get_global_function(‘runtime.config_threadpool’)

, which is very similar to what we did in remote.get_function(‘runtime.config_threadpool’)

remote is “RPsession(object)” with “get_function” which use “get_global_function” that can get global function. Therefore, I put get_global_function into python/runtime/module.py

And python/runtime/module.py will use ““get_global_func”” from tvm/_ffi/_ctypes/packed_func.py

May I ask are the above steps the correct way to follow to enable such setting?