Skip to content

Commit

Permalink
add warning to remind Optimizer() deprecates (intel-analytics#3062)
Browse files Browse the repository at this point in the history
* add warning to remind deprecates
  • Loading branch information
Le-Zheng authored Oct 23, 2020
1 parent 789a62d commit 82e1906
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/dllib/src/bigdl/dllib/optim/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from bigdl.util.common import init_engine
from bigdl.util.common import to_list
from bigdl.dataset.dataset import *
import warnings

if sys.version >= '3':
long = int
Expand Down Expand Up @@ -860,6 +861,8 @@ def __init__(self,
:param end_trigger: when to end the optimization
:param batch_size: training batch size
"""
warnings.warn("You are recommended to use `create` method to create an optimizer.")
assert isinstance(training_rdd, RDD), "Only type of RDD is allowed"
self.pvalue = DistriOptimizer(model,
training_rdd,
criterion,
Expand Down

0 comments on commit 82e1906

Please sign in to comment.