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

Method TypeCvt

src/opr/impl/basic_arith.cpp:739–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737MGB_DYN_TYPE_OBJ_FINAL_IMPL(TypeCvt);
738
739TypeCvt::TypeCvt(VarNode* inp, DType dest_type, const OperatorNodeConfig& config)
740 : Super{inp->owner_graph(),
741 config,
742 std::string("as") + dest_type.name(),
743 {inp}} {
744 init_megdnn_opr(*this, {});
745 mgb_assert(dest_type.valid());
746 add_input({inp});
747 add_equivalence_component<ScalarHash<const void*>>(dest_type.handle());
748 output(0)->dtype(dest_type).add_flag(VarNode::Flag::ALLOW_EMPTY_SHAPE);
749}
750
751SymbolVar TypeCvt::make(
752 SymbolVar input, DType dest_type, const OperatorNodeConfig& config) {

Callers 2

diag_plane_subgraphFunction · 0.80
typecvtFunction · 0.80

Calls 5

owner_graphMethod · 0.45
nameMethod · 0.45
validMethod · 0.45
handleMethod · 0.45
dtypeMethod · 0.45

Tested by 1

typecvtFunction · 0.64