未验证 提交 b5f0e5b5 编写于 作者: G Guanghua Yu 提交者: GitHub

fix framework warning (#2058)

上级 3dafbd94
...@@ -18,7 +18,6 @@ from __future__ import print_function ...@@ -18,7 +18,6 @@ from __future__ import print_function
from collections import OrderedDict from collections import OrderedDict
import copy import copy
import paddle
from paddle import fluid from paddle import fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Xavier from paddle.fluid.initializer import Xavier
...@@ -106,7 +105,7 @@ class FPN(object): ...@@ -106,7 +105,7 @@ class FPN(object):
out_shape=[body_input.shape[2], body_input.shape[3]], out_shape=[body_input.shape[2], body_input.shape[3]],
name=topdown_name) name=topdown_name)
return paddle.add(lateral, topdown) return fluid.layers.elementwise_add(lateral, topdown)
def get_output(self, body_dict): def get_output(self, body_dict):
""" """
......
...@@ -225,7 +225,7 @@ class MobileNetV3(object): ...@@ -225,7 +225,7 @@ class MobileNetV3(object):
return out return out
def _hard_swish(self, x): def _hard_swish(self, x):
return x * fluid.layers.relu6(x + 3) / 6. return fluid.layers.elementwise_mul(x, fluid.layers.relu6(x + 3) / 6.)
def _se_block(self, input, num_out_filter, ratio=4, name=None): def _se_block(self, input, num_out_filter, ratio=4, name=None):
lr_idx = self.curr_stage // 3 lr_idx = self.curr_stage // 3
......
...@@ -325,7 +325,8 @@ def DropBlock(input, block_size, keep_prob, is_test): ...@@ -325,7 +325,8 @@ def DropBlock(input, block_size, keep_prob, is_test):
elem_sum_m = fluid.layers.cast(elem_sum, dtype="float32") elem_sum_m = fluid.layers.cast(elem_sum, dtype="float32")
elem_sum_m.stop_gradient = True elem_sum_m.stop_gradient = True
output = input * mask * elem_numel_m / elem_sum_m output = fluid.layers.elementwise_mul(input,
mask) * elem_numel_m / elem_sum_m
return output return output
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册