return _ffi_node_api.AsRepr(self)
def __dir__(self):
+ class_names = dir(self.__class__)
fnames = _ffi_node_api.NodeListAttrNames(self)
size = fnames(-1)
- return [fnames(i) for i in range(size)]
+ return sorted([fnames(i) for i in range(size)] + class_names)
def __getattr__(self, name):
try:
"tir.UnrollLoop": 1
})
+def test_dict():
+ x = tvm.tir.const(1) # a class that has Python-defined methods
+ # instances should see the full class dict
+ assert set(dir(x.__class__)) <= set(dir(x))
+
+
if __name__ == "__main__":
test_string()
test_env_func()
test_const_saveload_json()
test_make_sum()
test_pass_config()
+ test_dict()