(self, node_id, option=None)
| 25 | self.graph.graph_config_, _ = self.graph.generate_graph_config() |
| 26 | |
| 27 | def __init__(self, node_id, option=None): |
| 28 | if option is None: |
| 29 | option = {} |
| 30 | self.dump_graph_ = 0 |
| 31 | if 'dump_graph' in option.keys(): |
| 32 | self.dump_graph_ = option['dump_graph'] |
| 33 | |
| 34 | # construct graph in init function |
| 35 | # create a bmf graph |
| 36 | from ..builder import bmf |
| 37 | self.graph = bmf.graph({ |
| 38 | 'dump_graph': self.dump_graph_, |
| 39 | 'graph_name': 'subgraph_node_%d' % (node_id) |
| 40 | }) |
| 41 | |
| 42 | self.inputs = [] |
| 43 | |
| 44 | # record if output stream is done |
| 45 | self.stream_done = {} |
| 46 | self.output_streams = None |
| 47 | |
| 48 | self.node_id_ = node_id |
| 49 | self.option_ = option |
| 50 | |
| 51 | self.create_graph(option) |
| 52 | |
| 53 | def process(self, task): |
| 54 | if self.graph is None: |
nothing calls this directly
no test coverage detected