gemini-code-assist[bot] commented on code in PR #308:
URL: https://github.com/apache/tvm-ffi/pull/308#discussion_r2585368648


##########
python/tvm_ffi/cython/function.pxi:
##########
@@ -824,6 +837,12 @@ cdef int TVMFFIPyArgSetterFactory_(PyObject* value, 
TVMFFIPyArgSetter* out) exce
     if hasattr(arg_class, "__tvm_ffi_float__"):
         out.func = TVMFFIPyArgSetterFloatProtocol_
         return 0
+    if hasattr(arg_class, "__tvm_ffi_opaque_ptr__"):
+        out.func = TVMFFIPyArgSetterFFIOpaquePtrCompatible_
+        return 0

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   This check for `__tvm_ffi_opaque_ptr__` is redundant as it's already handled 
earlier in the function, starting at line 813. Please remove this duplicated 
block to avoid confusion and unnecessary code.



##########
python/tvm_ffi/cython/function.pxi:
##########
@@ -674,6 +674,19 @@ cdef int TVMFFIPyArgSetterFloatProtocol_(
     return 0
 
 
+cdef int TVMFFIPyArgSetterFFIValueProtocol_(
+    TVMFFIPyArgSetter* handle, TVMFFIPyCallContext* ctx,
+    PyObject* py_arg, TVMFFIAny* out
+) except -1:
+    """Setter for class with __tvm_ffi_float__() method"""

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The docstring for `TVMFFIPyArgSetterFFIValueProtocol_` appears to be a 
copy-paste from another function. It should refer to `__tvm_ffi_value__()` 
instead of `__tvm_ffi_float__()` to accurately describe this setter's purpose.
   
   ```
       """Setter for class with __tvm_ffi_value__() method"""
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to