MCPcopy Create free account
hub / github.com/BabitMF/bmf / __init__

Method __init__

bmf/python_sdk/subgraph.py:27–51  ·  view source on GitHub ↗
(self, node_id, option=None)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 1

create_graphMethod · 0.95

Tested by

no test coverage detected