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

Method NonZero

src/opr/impl/misc.cpp:391–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389MGB_DYN_TYPE_OBJ_FINAL_IMPL(NonZero);
390
391NonZero::NonZero(VarNode* data, const Param& param, const OperatorNodeConfig& config)
392 : Super(data->owner_graph(), config, "NonZero", {data}) {
393 init_megdnn_opr(*this, param);
394 add_input({data});
395 auto dtype = megdnn_opr()->infer_type(data->dtype());
396 output(0)
397 ->add_flag(VarNode::Flag::NO_SYS_MEM_ALLOC)
398 .add_flag(VarNode::Flag::ALLOW_EMPTY_SHAPE)
399 .dtype(dtype);
400}
401
402NonZero::NodeProp* NonZero::do_make_node_prop() const {
403 auto ret = Super::do_make_node_prop();

Callers 1

non_zeroFunction · 0.80

Calls 3

infer_typeMethod · 0.80
owner_graphMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected