提交 f8373949 编写于 作者: M minqiyang

Polish code

test=develop
上级 7355d418
...@@ -56,10 +56,6 @@ class Tracer { ...@@ -56,10 +56,6 @@ class Tracer {
std::vector<VarBase*> PyTrace(OpBase* op, const std::vector<VarBase*>& inputs, std::vector<VarBase*> PyTrace(OpBase* op, const std::vector<VarBase*>& inputs,
bool stop_gradient = false); bool stop_gradient = false);
static void StartProfile();
static void StopProfile();
private: private:
platform::Place GetPlace(const VarBasePtrMap& inputs); platform::Place GetPlace(const VarBasePtrMap& inputs);
......
...@@ -290,7 +290,6 @@ class Variable(object): ...@@ -290,7 +290,6 @@ class Variable(object):
dtype='float32') dtype='float32')
""" """
# @profile
def __init__(self, def __init__(self,
block, block,
type=core.VarDesc.VarType.LOD_TENSOR, type=core.VarDesc.VarType.LOD_TENSOR,
...@@ -646,7 +645,6 @@ class Operator(object): ...@@ -646,7 +645,6 @@ class Operator(object):
'checkpoint_notify', 'gen_nccl_id' 'checkpoint_notify', 'gen_nccl_id'
} }
# @profile
def __init__(self, def __init__(self,
block, block,
desc, desc,
...@@ -1241,7 +1239,6 @@ class Block(object): ...@@ -1241,7 +1239,6 @@ class Block(object):
return (item[1] for item in six.iteritems(self.vars) return (item[1] for item in six.iteritems(self.vars)
if isinstance(item[1], Parameter)) if isinstance(item[1], Parameter))
# @profile
def create_var(self, *args, **kwargs): def create_var(self, *args, **kwargs):
var = Variable(block=self, *args, **kwargs) var = Variable(block=self, *args, **kwargs)
if 'initializer' in kwargs: if 'initializer' in kwargs:
...@@ -1350,7 +1347,6 @@ class Block(object): ...@@ -1350,7 +1347,6 @@ class Block(object):
initializer(param, self) initializer(param, self)
return param return param
# @profile
def append_op(self, *args, **kwargs): def append_op(self, *args, **kwargs):
""" """
Appends a new Operator according to the giving arguments. Appends a new Operator according to the giving arguments.
......
...@@ -97,7 +97,6 @@ class Conv2D(layers.Layer): ...@@ -97,7 +97,6 @@ class Conv2D(layers.Layer):
dtype=self._dtype, dtype=self._dtype,
is_bias=True) is_bias=True)
# @profile
def forward(self, input): def forward(self, input):
pre_bias = self._helper.create_variable_for_type_inference( pre_bias = self._helper.create_variable_for_type_inference(
dtype=self._dtype) dtype=self._dtype)
...@@ -170,7 +169,6 @@ class Pool2D(layers.Layer): ...@@ -170,7 +169,6 @@ class Pool2D(layers.Layer):
self._exclusive = exclusive self._exclusive = exclusive
self._l_type = 'pool2d' self._l_type = 'pool2d'
# @profile
def forward(self, input): def forward(self, input):
pool_out = self._helper.create_variable_for_type_inference(self._dtype) pool_out = self._helper.create_variable_for_type_inference(self._dtype)
...@@ -231,7 +229,6 @@ class FC(layers.Layer): ...@@ -231,7 +229,6 @@ class FC(layers.Layer):
else: else:
self._b = None self._b = None
# @profile
def forward(self, input): def forward(self, input):
tmp = self._helper.create_variable_for_type_inference(self._dtype) tmp = self._helper.create_variable_for_type_inference(self._dtype)
self._helper.append_op( self._helper.append_op(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册