-
Notifications
You must be signed in to change notification settings - Fork 1k
Dev fused nms #10643
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
base: master
Are you sure you want to change the base?
Dev fused nms #10643
Changes from all commits
a76191c
119e383
670ee0a
87969be
86a56cc
6d85296
f171b46
4393f7a
e0647bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2789,7 +2789,7 @@ | |
| bind_python: False | ||
|
|
||
| - name: "nms" | ||
| signature: "Tensor (Tensor x, Float iou_threshold, Int32 keep_n=-1) => Nms" | ||
| signature: "Tensor (Tensor x, Tensor scores=None, Tensor input_indices=None, Float iou_threshold, Int32 keep_n=-1) => Nms" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 看看是否需要/方便,为npu的nms导出独立的api/functor? |
||
| bind_python: True | ||
|
|
||
| - name: "roi_align" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4014,17 +4014,38 @@ class PariticalFCSampleDisableBoxing { | |||||
|
|
||||||
| class NmsFunctor { | ||||||
| public: | ||||||
| NmsFunctor() { op_ = CHECK_JUST(one::OpBuilder("nms").Input("in").Output("out").Build()); } | ||||||
| NmsFunctor() { | ||||||
| op_ = CHECK_JUST(one::OpBuilder("nms").Input("in").Output("out").Build()); | ||||||
| fused_op_ = CHECK_JUST(one::OpBuilder("nms") | ||||||
| .Input("in") | ||||||
| .Input("scores") | ||||||
| .Input("input_indices") | ||||||
| .Output("out") | ||||||
| .Build()); | ||||||
| } | ||||||
|
|
||||||
| Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& x, const float& iou_threshold, | ||||||
| Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& x, | ||||||
| const Optional<one::Tensor>& scores, | ||||||
| const Optional<one::Tensor>& input_indices, const float& iou_threshold, | ||||||
| const int32_t& keep_n) const { | ||||||
| auto& attrs = THREAD_CACHED_MUTABLE_ATTR_MAP("iou_threshold", "keep_n"); | ||||||
| attrs.SetAllAttrs(iou_threshold, keep_n); | ||||||
| return OpInterpUtil::Dispatch<Tensor>(*op_, {x}, attrs); | ||||||
| DeviceType device_type = JUST(x->device())->enum_type(); | ||||||
| if (device_type == DeviceType::kNPU) { | ||||||
| if (scores) { | ||||||
|
||||||
| if (scores) { | |
| if (scores && input_indices) { |
Uh oh!
There was an error while loading. Please reload this page.