From aaf756272f4d590e3f33eafd262e0fca2e0e6109 Mon Sep 17 00:00:00 2001 From: jerrywgz Date: Mon, 28 Jan 2019 06:11:04 +0000 Subject: [PATCH] remove inplace arg, test=develop --- paddle/fluid/API.spec | 2 +- python/paddle/fluid/layers/detection.py | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index b24c844b4..799fbb0f7 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -324,7 +324,7 @@ paddle.fluid.layers.iou_similarity ArgSpec(args=['x', 'y', 'name'], varargs=None paddle.fluid.layers.box_coder ArgSpec(args=['prior_box', 'prior_box_var', 'target_box', 'code_type', 'box_normalized', 'name'], varargs=None, keywords=None, defaults=('encode_center_size', True, None)) paddle.fluid.layers.polygon_box_transform ArgSpec(args=['input', 'name'], varargs=None, keywords=None, defaults=(None,)) paddle.fluid.layers.yolov3_loss ArgSpec(args=['x', 'gtbox', 'gtlabel', 'anchors', 'class_num', 'ignore_thresh', 'loss_weight_xy', 'loss_weight_wh', 'loss_weight_conf_target', 'loss_weight_conf_notarget', 'loss_weight_class', 'name'], varargs=None, keywords=None, defaults=(None, None, None, None, None, None)) -paddle.fluid.layers.box_clip ArgSpec(args=['input', 'im_info', 'inplace', 'name'], varargs=None, keywords=None, defaults=(False, None)) +paddle.fluid.layers.box_clip ArgSpec(args=['input', 'im_info', 'name'], varargs=None, keywords=None, defaults=(None,)) paddle.fluid.layers.accuracy ArgSpec(args=['input', 'label', 'k', 'correct', 'total'], varargs=None, keywords=None, defaults=(1, None, None)) paddle.fluid.layers.auc ArgSpec(args=['input', 'label', 'curve', 'num_thresholds', 'topk', 'slide_steps'], varargs=None, keywords=None, defaults=('ROC', 4095, 1, 1)) paddle.fluid.layers.exponential_decay ArgSpec(args=['learning_rate', 'decay_steps', 'decay_rate', 'staircase'], varargs=None, keywords=None, defaults=(False,)) diff --git a/python/paddle/fluid/layers/detection.py b/python/paddle/fluid/layers/detection.py index 4fd7e5739..fe2baa108 100644 --- a/python/paddle/fluid/layers/detection.py +++ b/python/paddle/fluid/layers/detection.py @@ -1963,7 +1963,7 @@ def generate_proposals(scores, return rpn_rois, rpn_roi_probs -def box_clip(input, im_info, inplace=False, name=None): +def box_clip(input, im_info, name=None): """ Clip the box into the size given by im_info For each input box, The formula is given as follows: @@ -1988,15 +1988,6 @@ def box_clip(input, im_info, inplace=False, name=None): layout (height, width, scale). height and width is the input size and scale is the ratio of input size and original size. - inplace(bool): Must use :attr:`False` if :attr:`input` is used in - multiple operators. If this flag is set :attr:`True`, - reuse input :attr:`input` to clip, which will - change the value of tensor variable :attr:`input` - and might cause errors when :attr:`input` is used - in multiple operators. If :attr:`False`, preserve the - value pf :attr:`input` and create a new output - tensor variable whose data is copied from input x but - cliped. name (str): The name of this layer. It is optional. Returns: @@ -2013,8 +2004,7 @@ def box_clip(input, im_info, inplace=False, name=None): """ helper = LayerHelper("box_clip", **locals()) - output = x if inplace else helper.create_variable_for_type_inference(\ - dtype=input.dtype) + output = helper.create_variable_for_type_inference(dtype=input.dtype) inputs = {"Input": input, "ImInfo": im_info} helper.append_op(type="box_clip", inputs=inputs, outputs={"Output": output}) -- GitLab