This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push:
new 07546c75 [COMPACT][TEMP] Array compact temp fix (#467)
07546c75 is described below
commit 07546c750337c73e1d74cf4e1a29c32fbee0c139
Author: Tianqi Chen <[email protected]>
AuthorDate: Fri Feb 20 10:03:16 2026 -0500
[COMPACT][TEMP] Array compact temp fix (#467)
In the 0.1.19 patch, we changed the operator[] to return T(from const
T). This is the right change. However, flashinfer depends on an sutble
implicit conversion rule that requires const T behavior (which is also
not desirable). There is a patch in flashinfer to fx this issue.
This PR is a temp workaround so 0.1.19 release won't block flashinfer.
We can reland this in next release as flashinfer's change gets into a
release.
---
include/tvm/ffi/container/array.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/tvm/ffi/container/array.h
b/include/tvm/ffi/container/array.h
index b59b1731..523aee2d 100644
--- a/include/tvm/ffi/container/array.h
+++ b/include/tvm/ffi/container/array.h
@@ -376,7 +376,7 @@ class Array : public ObjectRef {
* \param i The index
* \return the i-th element.
*/
- T operator[](int64_t i) const {
+ const T operator[](int64_t i) const {
ArrayObj* p = GetArrayObj();
if (p == nullptr) {
TVM_FFI_THROW(IndexError) << "cannot index a null array";