| 20 | MGB_DYN_TYPE_OBJ_FINAL_IMPL(InputCallback); |
| 21 | |
| 22 | InputCallback::InputCallback( |
| 23 | cg::ComputingGraph& graph, callback_t callback, const VarNodeArray& inputs, |
| 24 | const TensorShape& output_shape, const OperatorNodeConfig& config, |
| 25 | bool use_static_shape) |
| 26 | : Super(&graph, config, "input_callback", inputs), |
| 27 | m_output_shape(output_shape), |
| 28 | m_callback(callback), |
| 29 | m_use_static_shape(use_static_shape) { |
| 30 | for (VarNode* i : inputs) { |
| 31 | add_input({i}); |
| 32 | } |
| 33 | DType dt = config.output_dtype(); |
| 34 | mgb_assert(dt.valid()); |
| 35 | if (m_use_static_shape) { |
| 36 | mgb_assert(m_output_shape.ndim); |
| 37 | } |
| 38 | add_output(None) |
| 39 | ->add_flag(VarNode::Flag::ALLOW_EMPTY_SHAPE) |
| 40 | .add_flag(VarNode::Flag::NO_SYS_MEM_ALLOC) |
| 41 | .dtype(dt); |
| 42 | add_output(None) |
| 43 | ->add_flag(VarNode::Flag::ALLOW_EMPTY_SHAPE) |
| 44 | .add_flag(VarNode::Flag::NO_SYS_MEM_ALLOC) |
| 45 | .dtype(DType::from_enum(DTypeEnum::Byte)); |
| 46 | add_equivalence_component<ScalarHash<void*>>(this); |
| 47 | } |
| 48 | |
| 49 | SymbolVarArray InputCallback::make( |
| 50 | cg::ComputingGraph& graph, callback_t callback, CompNode comp_node, DType dtype, |
nothing calls this directly
no test coverage detected