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

Function InputPlaceholder

imperative/src/impl/proxy_graph.cpp:51–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 Tensor* m_tensor;
50
51 InputPlaceholder(
52 ComputingGraph& graph, Tensor* tensor = nullptr,
53 const DeviceTensorND& static_infer_value = {})
54 : Super(&graph, {}, "device_value", {}),
55 m_tensor(tensor),
56 m_static_infer_value(static_infer_value) {
57 mgb_assert(
58 m_static_infer_value.empty() ||
59 m_static_infer_value.comp_node() == CompNode::default_cpu());
60 add_output(None)->add_flag(VarNode::Flag::NO_SYS_MEM_ALLOC);
61 // never dedup
62 add_equivalence_component<ScalarHash<void*>>(this);
63 }
64
65 static SymbolVar make(ComputingGraph& graph, Tensor& tensor) {
66 auto opr = graph.insert_opr(std::make_unique<InputPlaceholder>(graph, &tensor));

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
comp_nodeMethod · 0.45

Tested by

no test coverage detected