From: ziheng Date: Fri, 16 Aug 2019 20:14:29 +0000 (-0700) Subject: [BUGFIX] Fix for NoneType Target (#3792) X-Git-Tag: upstream/0.7.0~2025 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b76b627b61879a15d746c307f28db7a0edd4e4fc;p=platform%2Fupstream%2Ftvm.git [BUGFIX] Fix for NoneType Target (#3792) --- diff --git a/python/tvm/relay/quantize/_partition.py b/python/tvm/relay/quantize/_partition.py index 597c55c..1180d83 100644 --- a/python/tvm/relay/quantize/_partition.py +++ b/python/tvm/relay/quantize/_partition.py @@ -133,7 +133,8 @@ def add_partition_generic(ref_call, new_args, ctx): @register_partition_function("add") def add_partition_function(ref_call, new_args, ctx): """Rewrite function for ewise add for partition""" - if 'cuda' in _target.current_target().keys: + target = _target.current_target() + if target and 'cuda' in target.keys: #TODO(wuwei/ziheng) cuda specific rules return add_partition_generic(ref_call, new_args, ctx) return add_partition_generic(ref_call, new_args, ctx)