-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add the support of arf op for ascend device (#2789)
- Loading branch information
Showing
6 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "pytorch_npu_helper.hpp" | ||
|
||
using namespace NPU_NAME_SPACE; | ||
using namespace std; | ||
|
||
void active_rotated_filter_forward_impl(const Tensor input, | ||
const Tensor indices, Tensor output); | ||
|
||
void active_rotated_filter_backward_impl(const Tensor grad_out, | ||
const Tensor indices, Tensor grad_in); | ||
|
||
void active_rotated_filter_forward_npu(const Tensor input, const Tensor indices, | ||
Tensor output) { | ||
OpCommand cmd; | ||
cmd.Name("ActiveRotatedFilter") | ||
.Input(input) | ||
.Input(indices) | ||
.Output(output) | ||
.Run(); | ||
} | ||
|
||
void active_rotated_filter_backward_npu(const Tensor grad_out, | ||
const Tensor indices, Tensor grad_in) { | ||
OpCommand cmd; | ||
cmd.Name("ActiveRotatedFilterGrad") | ||
.Input(grad_out) | ||
.Input(indices) | ||
.Output(grad_in) | ||
.Run(); | ||
} | ||
|
||
REGISTER_NPU_IMPL(active_rotated_filter_forward_impl, | ||
active_rotated_filter_forward_npu); | ||
|
||
REGISTER_NPU_IMPL(active_rotated_filter_backward_impl, | ||
active_rotated_filter_backward_npu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters