| 755 | } |
| 756 | |
| 757 | DctChannelSelectForward::DctChannelSelectForward( |
| 758 | VarNode* src, VarNode* mask_offset, VarNode* mask_val, const Param& param, |
| 759 | const OperatorNodeConfig& config) |
| 760 | : Super(OperatorNodeBaseCtorParam{ |
| 761 | src->owner_graph(), config, "dct_channel_select", {src}}) { |
| 762 | init_megdnn_opr(*this, param); |
| 763 | add_input({src, mask_offset, mask_val}); |
| 764 | if (mask_offset != nullptr) { |
| 765 | mgb_assert( |
| 766 | mask_val, "mask_val should not be null when mask_offset is not null"); |
| 767 | auto host_offset = mask_offset->owner_opr() |
| 768 | ->cast_final_safe<opr::ImmutableTensor>() |
| 769 | .host_value(); |
| 770 | auto host_val = mask_val->owner_opr() |
| 771 | ->cast_final_safe<opr::ImmutableTensor>() |
| 772 | .host_value(); |
| 773 | |
| 774 | valid_mask( |
| 775 | host_offset.ptr<int>(), host_offset.layout().total_nr_elems(), |
| 776 | host_val.ptr<int>(), host_val.layout().total_nr_elems(), param); |
| 777 | } |
| 778 | intl::MegDNNOprInitPostCtor<DctChannelSelectForward>::apply(*this); |
| 779 | } |
| 780 | |
| 781 | SymbolVar DctChannelSelectForward::make( |
| 782 | SymbolVar src, SymbolVar mask_offset, SymbolVar mask_val, const Param& param, |
nothing calls this directly
no test coverage detected