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

Method RegisterReflection

tests/cpp/testing_object.h:159–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157 TPrimExprObj(std::string dtype, double value) : dtype(dtype), value(value) {}
158
159 static void RegisterReflection() {
160 namespace refl = tvm::ffi::reflection;
161 refl::ObjectDef<TPrimExprObj>()
162 .def_rw("dtype", &TPrimExprObj::dtype, "dtype field", refl::default_value("float"))
163 .def_ro("value", &TPrimExprObj::value, "value field", refl::default_value(0))
164 .def("sub", [](TPrimExprObj* self, double other) -> double {
165 // this is ok because TPrimExprObj is declared asmutable
166 return self->value - other;
167 });
168 }
169
170 static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
171 static constexpr bool _type_mutable = true;

Callers

nothing calls this directly

Calls 1

default_valueClass · 0.85

Tested by

no test coverage detected