MCPcopy Create free account
hub / github.com/apache/tvm-ffi / TInt

Class TInt

tests/cpp/testing_object.h:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71};
72
73class 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
90inline void TIntObj::RegisterReflection() {
91 namespace refl = tvm::ffi::reflection;

Callers 14

TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
StaticAddMethod · 0.70
RegisterReflectionMethod · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.50

Calls

no outgoing calls

Tested by 14

TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
StaticAddMethod · 0.56
RegisterReflectionMethod · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.40