|
16 | 16 | # under the License. |
17 | 17 | """Utilities for meta schedule""" |
18 | 18 | import ctypes |
19 | | -import json |
20 | 19 | import logging |
21 | 20 | import os |
22 | 21 | import shutil |
23 | 22 | from contextlib import contextmanager |
24 | | -from typing import Any, List, Dict, Callable, Optional, Union |
| 23 | +from typing import Any, Callable, Dict, List, Optional, Union |
25 | 24 |
|
26 | 25 | import psutil # type: ignore |
27 | 26 | from tvm._ffi import get_global_func, register_func |
@@ -296,31 +295,6 @@ def _json_de_tvm(obj: Any) -> Any: |
296 | 295 | raise TypeError("Not supported type: " + str(type(obj))) |
297 | 296 |
|
298 | 297 |
|
299 | | -@register_func("meta_schedule.json_obj2str") |
300 | | -def json_obj2str(json_obj: Any) -> str: |
301 | | - json_obj = _json_de_tvm(json_obj) |
302 | | - return json.dumps(json_obj) |
303 | | - |
304 | | - |
305 | | -@register_func("meta_schedule.batch_json_str2obj") |
306 | | -def batch_json_str2obj(json_strs: List[str]) -> List[Any]: |
307 | | - """Covert a list of JSON strings to a list of json objects. |
308 | | - Parameters |
309 | | - ---------- |
310 | | - json_strs : List[str] |
311 | | - The list of JSON strings |
312 | | - Returns |
313 | | - ------- |
314 | | - result : List[Any] |
315 | | - The list of json objects |
316 | | - """ |
317 | | - return [ |
318 | | - json.loads(json_str) |
319 | | - for json_str in map(str.strip, json_strs) |
320 | | - if json_str and (not json_str.startswith("#")) and (not json_str.startswith("//")) |
321 | | - ] |
322 | | - |
323 | | - |
324 | 298 | def shash2hex(mod: IRModule) -> str: |
325 | 299 | """Get the structural hash of a module. |
326 | 300 |
|
|
0 commit comments