Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

【PaddlePaddle Hackathon 68】add argmax and argmin op #946

Merged
merged 12 commits into from
Sep 27, 2022

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Sep 17, 2022

rfc:PaddlePaddle/community#192
本pr利用argsort实现了argmax和argmin算子,同时修复了argsort的一个bug

在原本的argsort中,返回的结果是某个位置的大小排序,但按照最初的rfc,返回的应该是按照从大到小排序后的返回索引值例子如下。

错误的argsort

argsort([5, 4, 9, 1]) = [2, 1, 3, 0]

期望的argsort

argsort([5, 4, 9, 1]) = [3, 1, 0, 2]

# Conflicts:
#	cinn/frontend/net_builder.h
#	cinn/hlir/op/contrib/CMakeLists.txt
#	cinn/hlir/op/use_ops.h
#	cinn/pybind/frontend.cc
@zrr1999 zrr1999 changed the title Argmax 【PaddlePaddle Hackathon 68】add argmax and argmin op Sep 18, 2022
@zrr1999 zrr1999 marked this pull request as ready for review September 19, 2022 03:05
Copy link
Collaborator

@haozech haozech left a comment

Choose a reason for hiding this comment

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

LGTM

@haozech haozech merged commit 9ff559d into PaddlePaddle:develop Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants