Commit 17261566 authored by Yuxin Wu's avatar Yuxin Wu

don't warn too much about deprecation

parent b325e257
...@@ -12,6 +12,7 @@ from ..tfutils.tower import TowerContext ...@@ -12,6 +12,7 @@ from ..tfutils.tower import TowerContext
from ..input_source import PlaceholderInput from ..input_source import PlaceholderInput
from ..utils.develop import log_deprecated from ..utils.develop import log_deprecated
from ..utils.argtools import log_once from ..utils.argtools import log_once
from ..utils.utils import execute_only_once
__all__ = ['PredictorBase', 'AsyncPredictorBase', __all__ = ['PredictorBase', 'AsyncPredictorBase',
'OnlinePredictor', 'OfflinePredictor', 'OnlinePredictor', 'OfflinePredictor',
...@@ -41,10 +42,11 @@ class PredictorBase(object): ...@@ -41,10 +42,11 @@ class PredictorBase(object):
""" """
if len(args) == 1 and isinstance(args[0], (list, tuple)): if len(args) == 1 and isinstance(args[0], (list, tuple)):
dp = args[0] # backward-compatibility dp = args[0] # backward-compatibility
log_deprecated( if execute_only_once():
"Calling a predictor with one datapoint", log_deprecated(
"Call it with positional arguments instead!", "Calling a predictor with one datapoint",
"2018-3-1") "Call it with positional arguments instead!",
"2018-3-1")
else: else:
dp = args dp = args
output = self._do_call(dp) output = self._do_call(dp)
......
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