Skip to content

Commit

Permalink
update example code
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuwenyu committed Aug 24, 2021
1 parent 5b3b769 commit b6b8311
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/paddle/vision/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,13 @@ def roi_pool(input,
Examples:
.. code-block:: python
import paddle
import paddle.vision.ops as ops
data = paddle.rand([1, 256, 32, 32])
boxes = paddle.rand([3, 4])
boxes[:, 2] += boxes[:, 0] + 3
boxes[:, 3] += boxes[:, 1] + 4
boxes_num = paddle.to_tensor([3]).astype('int32')
pool_out = roi_pool(data, boxes, boxes_num=boxes_num, output_size=3)
pool_out = ops.roi_pool(data, boxes, boxes_num=boxes_num, output_size=3)
assert pool_out.shape == [3, 256, 3, 3], ''
"""
check_type(output_size, 'output_size', (int, tuple), 'roi_pool')
Expand Down

0 comments on commit b6b8311

Please sign in to comment.