Hi everyone,
I just wander why union TVMValue does not support `uint64`? I think `uint64` is
very useful in some cases like create a large const value `tvm.const(value,
'uint64')`. It seems TVMValue does not have `uint64` at all. But, accually,
`DLDataTypeCode` has `kDLUint`. May i know why it is designed?
```
# _ffi/_ctypes/types.py
class TVMValue(ctypes.Union):
"""TVMValue in C API"""
_fields_ = [("v_int64", ctypes.c_int64),
("v_float64", ctypes.c_double),
("v_handle", ctypes.c_void_p),
("v_str", ctypes.c_char_p)]
# _ffi/_cython/base.pxi
ctypedef struct TVMValue:
int64_t v_int64
double v_float64
void* v_handle
const char* v_str
DLDataType v_type
DLContext v_ctx
```
```
// dlpack/include/dlpack/dlpack.h
/*!
* \brief The type code options DLDataType.
*/
typedef enum {
kDLInt = 0U,
kDLUInt = 1U,
kDLFloat = 2U,
} DLDataTypeCode;
```
Also anthor doubt about `_const`, `tvm.const` has the type option, but it
appears useless. :frowning:
```
# src/api/api_lang.cc
TVM_REGISTER_API("_const")
.set_body([](TVMArgs args, TVMRetValue* ret) {
if (args[0].type_code() == kDLInt) {
*ret = make_const(args[1], args[0].operator int64_t());
} else if (args[0].type_code() == kDLFloat) {
*ret = make_const(args[1], args[0].operator double());
} else {
LOG(FATAL) << "only accept int or float";
}
});
```
Many thanks.
---
[Visit
Topic](http://tracking.discuss.tvm.ai/tracking/click?d=yj3XiivBtPcgCOHFJEq7c3tddpH_cxecsTEr9d_SBkk7iaPdyTIziPF4Ko5L-e9mOdN86jCVyeE8wbmF18kcaiIYEwxnDCFln9Ychl_Roit0qItCC0NwlDE-hatnF1GA0wkiaVx7MMy-c1vexGwHlyryUplnPHSR_On_CDOgETcc0)
to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click
here](http://tracking.discuss.tvm.ai/tracking/click?d=7cFgOaAA4XIBVlVKt_oyC07uihTjg4Q6cjeBRNRTiPo5aCgNxedB0LbKVfiV5DahMcXRZGM6mKGAJWiY5JP0hDvm-jGBaqmGi8ryfQiXwlejvHtaVgLeOir_aFqhrl7bIc2ywOPmtdKfBuOE04LRKjeYi6JZNV3338qwMUIfhGWgVuaFcqKoJKNN6cRdcmvqQoOLoRANKzpLorBq59iDPCr9RGxDuZtENQS00S1m2dne0).
Tianqi Chen, UW, Seattle, WA, 98105, United States
http://tracking.discuss.tvm.ai/tracking/unsubscribe?msgid=X3RNFhsijMrExnwQKtjc7w2