From 9c19c12a4a602d60fafaf06479f0e2118c8cd10c Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Wed, 14 Feb 2024 10:19:36 -0600 Subject: [PATCH] Lint fix The `span` field was only ever used to construct a TIR constant with a known span, wasn't used at any of its callsites. --- python/tvm/runtime/object_generic.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/python/tvm/runtime/object_generic.py b/python/tvm/runtime/object_generic.py index 32962dc872307..20909c53c7876 100644 --- a/python/tvm/runtime/object_generic.py +++ b/python/tvm/runtime/object_generic.py @@ -38,7 +38,7 @@ def asobject(self): ObjectTypes = (ObjectBase, NDArrayBase, Module, ObjectRValueRef, PackedFuncBase, PyNativeObject) -def convert_to_object(value, span=None): +def convert_to_object(value): """Convert a Python value to corresponding object type. Type conversions performed by this function must *only* produce @@ -54,9 +54,6 @@ def convert_to_object(value, span=None): value : str The value to be inspected. - span : Optional[Span] - The location of this itervar in the source code. - Returns ------- obj : Object @@ -90,16 +87,13 @@ def convert_to_object(value, span=None): raise TypeError(f"don't know how to convert type {type(value)} to object") -def convert(value, span=None): +def convert(value): """Convert value to TVM object or function. Parameters ---------- value : python value - span : Optional[Span] - The location of this statement in the source code. - Returns ------- tvm_val : Object or Function @@ -111,7 +105,7 @@ def convert(value, span=None): the codebase. We can choose one to keep and discard the other one later. """ - return convert_to_object(value, span=span) + return convert_to_object(value) def _scalar_type_inference(value):