-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and omptimize flip API #34379
Fix and omptimize flip API #34379
Conversation
Thanks for your contribution! |
python/paddle/tensor/manipulation.py
Outdated
@@ -240,10 +240,17 @@ def flip(x, axis, name=None): | |||
x = np.arange(image_shape[0] * image_shape[1] * image_shape[2]).reshape(image_shape) | |||
x = x.astype('float32') | |||
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]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
结果里面是不是有逗号少了
python/paddle/tensor/manipulation.py
Outdated
|
||
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]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
fix doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Function optimization
PR changes
APIs
Describe