Skip to content

Commit aaf7562

Browse files
committed
remove inplace arg, test=develop
1 parent e60c843 commit aaf7562

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

paddle/fluid/API.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ paddle.fluid.layers.iou_similarity ArgSpec(args=['x', 'y', 'name'], varargs=None
324324
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))
325325
paddle.fluid.layers.polygon_box_transform ArgSpec(args=['input', 'name'], varargs=None, keywords=None, defaults=(None,))
326326
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))
327-
paddle.fluid.layers.box_clip ArgSpec(args=['input', 'im_info', 'inplace', 'name'], varargs=None, keywords=None, defaults=(False, None))
327+
paddle.fluid.layers.box_clip ArgSpec(args=['input', 'im_info', 'name'], varargs=None, keywords=None, defaults=(None,))
328328
paddle.fluid.layers.accuracy ArgSpec(args=['input', 'label', 'k', 'correct', 'total'], varargs=None, keywords=None, defaults=(1, None, None))
329329
paddle.fluid.layers.auc ArgSpec(args=['input', 'label', 'curve', 'num_thresholds', 'topk', 'slide_steps'], varargs=None, keywords=None, defaults=('ROC', 4095, 1, 1))
330330
paddle.fluid.layers.exponential_decay ArgSpec(args=['learning_rate', 'decay_steps', 'decay_rate', 'staircase'], varargs=None, keywords=None, defaults=(False,))

python/paddle/fluid/layers/detection.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ def generate_proposals(scores,
19631963
return rpn_rois, rpn_roi_probs
19641964

19651965

1966-
def box_clip(input, im_info, inplace=False, name=None):
1966+
def box_clip(input, im_info, name=None):
19671967
"""
19681968
Clip the box into the size given by im_info
19691969
For each input box, The formula is given as follows:
@@ -1988,15 +1988,6 @@ def box_clip(input, im_info, inplace=False, name=None):
19881988
layout (height, width, scale). height and width
19891989
is the input size and scale is the ratio of input
19901990
size and original size.
1991-
inplace(bool): Must use :attr:`False` if :attr:`input` is used in
1992-
multiple operators. If this flag is set :attr:`True`,
1993-
reuse input :attr:`input` to clip, which will
1994-
change the value of tensor variable :attr:`input`
1995-
and might cause errors when :attr:`input` is used
1996-
in multiple operators. If :attr:`False`, preserve the
1997-
value pf :attr:`input` and create a new output
1998-
tensor variable whose data is copied from input x but
1999-
cliped.
20001991
name (str): The name of this layer. It is optional.
20011992
20021993
Returns:
@@ -2013,8 +2004,7 @@ def box_clip(input, im_info, inplace=False, name=None):
20132004
"""
20142005

20152006
helper = LayerHelper("box_clip", **locals())
2016-
output = x if inplace else helper.create_variable_for_type_inference(\
2017-
dtype=input.dtype)
2007+
output = helper.create_variable_for_type_inference(dtype=input.dtype)
20182008
inputs = {"Input": input, "ImInfo": im_info}
20192009
helper.append_op(type="box_clip", inputs=inputs, outputs={"Output": output})
20202010

0 commit comments

Comments
 (0)