Commit 6e5c65ac by Wuwei Lin Committed by Tianqi Chen

Remove duplicated functions in relay_integration (#2370)

parent a42d1e3c
......@@ -9,7 +9,7 @@ import warnings
import logging
from ... import tensor, placeholder, target as _target
from ... import target as _target
from .task import create
from .topi_integration import TaskExtractEnv
......@@ -17,38 +17,6 @@ from .topi_integration import TaskExtractEnv
logger = logging.getLogger('autotvm')
def serialize_args(args):
"""serialize arguments of a topi function to a hashable tuple.
Parameters
----------
args: list of hashable or Tensor
"""
ret = []
for t in args:
if isinstance(t, tensor.Tensor):
ret.append(('TENSOR', get_const_tuple(t.shape), t.dtype))
else:
ret.append(t)
return tuple(ret)
def deserialize_args(args):
"""The inverse function of :code:`serialize_args`.
Parameters
----------
args: list of hashable or Tensor
"""
ret = []
for t in args:
if isinstance(t, tuple) and t[0] == 'TENSOR':
ret.append(placeholder(shape=t[1], dtype=t[2]))
else:
ret.append(t)
return ret
def extract_from_program(func, params, ops, target, target_host=None):
""" Extract tuning tasks from a relay program.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment