tqchen commented on a change in pull request #5484:
URL: https://github.com/apache/incubator-tvm/pull/5484#discussion_r419623185



##########
File path: python/tvm/_ffi/_ctypes/packed_func.py
##########
@@ -141,6 +141,17 @@ def _make_tvm_args(args, temp_args):
         elif isinstance(arg, TVMContext):
             values[i].v_int64 = _ctx_to_int64(arg)
             type_codes[i] = TypeCode.TVM_CONTEXT
+        elif isinstance(arg, bytes):

Review comment:
       Good pt `(ctypes.char * n).from_buffer` only takes bytearray, so in the 
case of bytes, we have to construct a bytearray and push to the temp. 
   
   In the case of bytearray we can directly use it as it is. We can certainly 
try to unify a bit by having a wrapper function to further check for bytes. 
That was the original reason for not unifying the two. I will try to take 
anoter stab




----------------------------------------------------------------
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]


Reply via email to