| 71 | }; |
| 72 | |
| 73 | class TInt : public TNumber { |
| 74 | public: |
| 75 | explicit TInt(int64_t value) { data_ = make_object<TIntObj>(value); } |
| 76 | |
| 77 | static TInt StaticAdd(TInt lhs, TInt rhs) { return TInt(lhs->value + rhs->value); } |
| 78 | |
| 79 | static int64_t CustomAnyHash(const Any& src) { |
| 80 | return static_cast<int64_t>(src.cast<TInt>()->value + 1024); |
| 81 | } |
| 82 | |
| 83 | static bool CustomAnyEqual(const Any& lhs, const Any& rhs) { |
| 84 | return lhs.cast<TInt>()->value == rhs.cast<TInt>()->value; |
| 85 | } |
| 86 | |
| 87 | TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(TInt, TNumber, TIntObj); |
| 88 | }; |
| 89 | |
| 90 | inline void TIntObj::RegisterReflection() { |
| 91 | namespace refl = tvm::ffi::reflection; |