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

Class TFloat

tests/cpp/testing_object.h:125–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123};
124
125class TFloat : public TNumber {
126 public:
127 explicit TFloat(double value) { data_ = make_object<TFloatObj>(value); }
128
129 static uint64_t CustomAnyHash(const Any& src) {
130 double value = src.cast<TFloat>()->value;
131 return static_cast<int64_t>(value * 10 + 2048);
132 }
133
134 static bool CustomAnyEqual(const Any& lhs, const Any& rhs) {
135 return lhs.cast<TFloat>()->value == rhs.cast<TFloat>()->value;
136 }
137
138 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(TFloat, TNumber, TFloatObj);
139};
140
141inline void TFloatObj::RegisterReflection() {
142 namespace refl = tvm::ffi::reflection;

Callers 6

TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 6

TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68