Skip to content

Commit

Permalink
Update operator.py (apache#9402)
Browse files Browse the repository at this point in the history
  • Loading branch information
piiswrong authored Jan 12, 2018
1 parent f129992 commit 47a3422
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/mxnet/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from __future__ import absolute_import

import traceback
import warnings

from array import array
from threading import Lock
Expand All @@ -47,6 +48,7 @@ class PythonOp(object):
def __init__(self, need_top_grad=True):
self.info_ = None
self.need_top_grad_ = need_top_grad
warnings.warn('PythonOp has been deprecated. Please use CustomOp')

def __call__(self, *args, **kwargs):
return self.get_symbol(*args, **kwargs)
Expand Down Expand Up @@ -152,6 +154,7 @@ class NumpyOp(PythonOp):
"""
def __init__(self, need_top_grad=True):
super(NumpyOp, self).__init__(need_top_grad)
warnings.warn('NumpyOp has been deprecated. Please use CustomOp')

def get_symbol(self, *args, **kwargs):
fb_functype = CFUNCTYPE(None, c_int, POINTER(POINTER(mx_float)), POINTER(c_int),
Expand Down Expand Up @@ -254,6 +257,7 @@ class NDArrayOp(PythonOp):
"""
def __init__(self, need_top_grad=True):
super(NDArrayOp, self).__init__(need_top_grad)
warnings.warn('NDArrayOp has been deprecated. Please use CustomOp')

def get_symbol(self, *args, **kwargs):
fb_functype = CFUNCTYPE(c_bool, c_int, POINTER(c_void_p), POINTER(c_int), c_void_p)
Expand Down

0 comments on commit 47a3422

Please sign in to comment.