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

Method shallow_copy

imperative/src/impl/opr_utility.cpp:112–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112cg::OperatorNodeBase* InputCallback::shallow_copy(
113 const serialization::OprShallowCopyContext& ctx,
114 const cg::OperatorNodeBase& opr_, const VarNodeArray& inputs,
115 const OperatorNodeConfig& config) {
116 auto&& opr = opr_.cast_final_safe<InputCallback>();
117 auto* graph = ctx.owner_graph(opr, inputs);
118 return graph->insert_opr(std::make_unique<InputCallback>(
119 *graph, opr.m_callback, inputs, opr.m_output_shape, config,
120 opr.m_use_static_shape));
121}
122
123MGB_REG_OPR_SHALLOW_COPY(InputCallback, InputCallback::shallow_copy);
124

Callers

nothing calls this directly

Calls 2

owner_graphMethod · 0.45
insert_oprMethod · 0.45

Tested by

no test coverage detected