gemini-code-assist[bot] commented on code in PR #435:
URL: https://github.com/apache/tvm-ffi/pull/435#discussion_r2777541625
##########
python/tvm_ffi/_optional_torch_c_dlpack.py:
##########
@@ -109,6 +109,11 @@ def load_torch_c_dlpack_extension() -> Any: # noqa:
PLR0912, PLR0915
return None
except ImportError:
pass
+ except AttributeError:
+ # When torch_c_dlpack_ext and torch have different ABI
+ # `ctypes.CDLL` will raise an `AttributeError`.
+ # Keep trying JIT
Review Comment:

The comment here is slightly inaccurate. `ctypes.CDLL` raises an `OSError`
on loading failure, while an `AttributeError` is raised upon accessing a
non-existent symbol in the loaded library, which can happen with an ABI
mismatch. For improved clarity and technical accuracy, I suggest rephrasing the
comment.
```suggestion
# When torch_c_dlpack_ext and torch have different ABI, an
`AttributeError`
# may be raised when accessing symbols from the shared library via
ctypes.
# Keep trying JIT
```
--
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]