@@ -84,8 +84,7 @@ class AttrFieldInfoNode : public Object {
8484
8585 static constexpr const char * _type_key = " ir.AttrFieldInfo" ;
8686 static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode ;
87- static constexpr bool _type_has_method_sequal_reduce = false ;
88- static constexpr bool _type_has_method_shash_reduce = false ;
87+
8988 TVM_DECLARE_FINAL_OBJECT_INFO (AttrFieldInfoNode, Object);
9089};
9190
@@ -123,8 +122,7 @@ class BaseAttrsNode : public Object {
123122 bool allow_unknown = false ) = 0;
124123
125124 static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode ;
126- static constexpr const bool _type_has_method_sequal_reduce = true ;
127- static constexpr const bool _type_has_method_shash_reduce = true ;
125+
128126 static constexpr const char * _type_key = " ir.Attrs" ;
129127 TVM_DECLARE_BASE_OBJECT_INFO (BaseAttrsNode, Object);
130128};
@@ -154,11 +152,6 @@ class DictAttrsNode : public BaseAttrsNode {
154152 rfl::ObjectDef<DictAttrsNode>().def_ro (" __dict__" , &DictAttrsNode::dict);
155153 }
156154
157- bool SEqualReduce (const DictAttrsNode* other, SEqualReducer equal) const {
158- return equal (dict, other->dict );
159- }
160-
161- void SHashReduce (SHashReducer hash_reduce) const { hash_reduce (dict); }
162155 void InitByPackedArgs (const ffi::PackedArgs& args, bool allow_unknown) final ;
163156
164157 // type info
@@ -394,32 +387,6 @@ class AttrsNodeReflAdapter : public BaseAttrsNode {
394387 LOG (FATAL) << " `" << DerivedType::_type_key << " ` uses new reflection mechanism for init" ;
395388 }
396389
397- bool SEqualReduce (const DerivedType* other, SEqualReducer equal) const {
398- const TVMFFITypeInfo* type_info = TVMFFIGetTypeInfo (DerivedType::RuntimeTypeIndex ());
399- bool success = true ;
400- ffi::reflection::ForEachFieldInfoWithEarlyStop (
401- type_info, [&](const TVMFFIFieldInfo* field_info) {
402- ffi::reflection::FieldGetter field_getter (field_info);
403- ffi::Any field_value = field_getter (self ());
404- ffi::Any other_field_value = field_getter (other);
405- if (!equal.AnyEqual (field_value, other_field_value)) {
406- success = false ;
407- return true ;
408- }
409- return false ;
410- });
411- return success;
412- }
413-
414- void SHashReduce (SHashReducer hash_reducer) const {
415- const TVMFFITypeInfo* type_info = TVMFFIGetTypeInfo (DerivedType::RuntimeTypeIndex ());
416- ffi::reflection::ForEachFieldInfo (type_info, [&](const TVMFFIFieldInfo* field_info) {
417- ffi::reflection::FieldGetter field_getter (field_info);
418- ffi::Any field_value = field_getter (self ());
419- hash_reducer (field_value);
420- });
421- }
422-
423390 private:
424391 DerivedType* self () const {
425392 return const_cast <DerivedType*>(static_cast <const DerivedType*>(this ));
0 commit comments