MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / DctChannelSelectForward

Method DctChannelSelectForward

src/opr/impl/imgproc.cpp:757–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755}
756
757DctChannelSelectForward::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
781SymbolVar DctChannelSelectForward::make(
782 SymbolVar src, SymbolVar mask_offset, SymbolVar mask_val, const Param& param,

Callers

nothing calls this directly

Calls 5

applyFunction · 0.50
owner_graphMethod · 0.45
owner_oprMethod · 0.45
total_nr_elemsMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected