| 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)); |