Skip to content

Fix and omptimize flip API#34379

Merged
wangxicoding merged 3 commits intoPaddlePaddle:developfrom
sljlp:fix_and_ompt_flip
Jul 26, 2021
Merged

Fix and omptimize flip API#34379
wangxicoding merged 3 commits intoPaddlePaddle:developfrom
sljlp:fix_and_ompt_flip

Conversation

@sljlp
Copy link
Contributor

@sljlp sljlp commented Jul 26, 2021

PR types

Function optimization

PR changes

APIs

Describe

  1. add a feature supporting axis's type to be int in paddle.flip
  2. use core.ops.flip in dygraph mode
  3. update English doc for paddle.flip

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

img = paddle.to_tensor(x)
out = paddle.flip(img, [0,1])
tmp = paddle.flip(img, [0,1])
print(tmp) # [[[10,11][8, 9]],[[6, 7],[4, 5]] [[2, 3],[0, 1]]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结果里面是不是有逗号少了


print(out) # [[[10,11][8, 9]],[[6, 7],[4, 5]] [[2, 3],[0, 1]]]
out = paddle.flip(tmp,-1)
print(out) # [[[11,10][9, 8]],[[7, 6],[5, 4]] [[3, 2],[1, 0]]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@wangxicoding wangxicoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangxicoding wangxicoding merged commit df27c26 into PaddlePaddle:develop Jul 26, 2021
@sljlp sljlp deleted the fix_and_ompt_flip branch July 27, 2021 12:21
fuyinno4 pushed a commit that referenced this pull request Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants