diff --git a/python/tvm/relay/frontend/tensorflow.py b/python/tvm/relay/frontend/tensorflow.py index 74c2233a517a..9a3d59e43dbc 100644 --- a/python/tvm/relay/frontend/tensorflow.py +++ b/python/tvm/relay/frontend/tensorflow.py @@ -853,17 +853,17 @@ def _impl(inputs, attr, params, mod): boxes = inputs[0] scores = inputs[1] try: - max_output_size = int(np.atleast_1d(inputs[2].data.asnumpy().astype("int64"))[0]) + max_output_size = int(np.atleast_1d(inputs[2].data.numpy().astype("int64"))[0]) except Exception: try: max_output_size = ( - _infer_value(inputs[2], params, mod).asnumpy().astype("int64").tolist()[0] + _infer_value(inputs[2], params, mod).numpy().astype("int64").tolist()[0] ) except Exception: max_output_size = inputs[2] max_total_size = inputs[3] - iou_threshold = np.atleast_1d(inputs[4].data.asnumpy())[0] - score_threshold = np.atleast_1d(inputs[5].data.asnumpy())[0] + iou_threshold = np.atleast_1d(inputs[4].data.numpy())[0] + score_threshold = np.atleast_1d(inputs[5].data.numpy())[0] if attr["pad_per_class"]: raise tvm.error.OpAttributeUnImplemented( "pad_per_class for CombinedNonMaxSuppression is not supported" diff --git a/python/tvm/topi/vision/nms.py b/python/tvm/topi/vision/nms.py index 1fe03fc2a628..65dc6136b2a6 100644 --- a/python/tvm/topi/vision/nms.py +++ b/python/tvm/topi/vision/nms.py @@ -22,9 +22,9 @@ from tvm.te import hybrid from tvm.tir import if_then_else -from ..sort import sort, argsort, topk +from ..sort import argsort, topk from ..math import cast -from ..transform import reshape, arange, expand_dims, gather +from ..transform import reshape, gather from .. import reduction from ..scan import cumsum from .nms_util import (