MCPcopy Index your code
hub / github.com/OpenPPL/ppq / TrainableBlock

Class TrainableBlock

ppq/quantization/algorithm/training.py:172–188  ·  view source on GitHub ↗

TrainableBlock refers to a limited subgraph extracted from integrated computational graph. TrainableBlock have exact one input node and one output node, while its depth(the distance from input node to output node) is limited. Formal definition of TrainableBlock can be found with fol

Source from the content-addressed store, hash-verified

170
171
172class TrainableBlock:
173 """TrainableBlock refers to a limited subgraph extracted from integrated
174 computational graph. TrainableBlock have exact one input node and one
175 output node, while its depth(the distance from input node to output node)
176 is limited.
177
178 Formal definition of TrainableBlock can be found with following code of BlockBuilder
179
180 Minimal TrainableBlock is {p, p, {p}}, this block have only one node as both input and output.
181 """
182 def __init__(self, sp: Operation, ep: Operation, rps: List[Operation]) -> None:
183 self.sp = sp # 起始节点
184 self.ep = ep # 终止节点
185 self.rps = rps # 中继节点
186
187 def __str__(self) -> str:
188 return f'[Graph Block from {self.sp.name} to {self.ep.name}]'
189
190
191class BlockBuilder:

Callers 1

create_blockMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected