| 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; |
nothing calls this directly
no test coverage detected