beanmachine.ppl.compiler.copy_and_replace module

class beanmachine.ppl.compiler.copy_and_replace.Cloner(original: beanmachine.ppl.compiler.bm_graph_builder.BMGraphBuilder)

Bases: object

clone(original: beanmachine.ppl.compiler.bmg_nodes.BMGNode, parents: List[beanmachine.ppl.compiler.bmg_nodes.BMGNode]) beanmachine.ppl.compiler.bmg_nodes.BMGNode
class beanmachine.ppl.compiler.copy_and_replace.NodeTransformer

Bases: object

assess_node(node: beanmachine.ppl.compiler.bmg_nodes.BMGNode, original: beanmachine.ppl.compiler.bm_graph_builder.BMGraphBuilder) beanmachine.ppl.compiler.copy_and_replace.TransformAssessment
transform_node(node: beanmachine.ppl.compiler.bmg_nodes.BMGNode, new_inputs: List[beanmachine.ppl.compiler.bmg_nodes.BMGNode]) Optional[Union[beanmachine.ppl.compiler.bmg_nodes.BMGNode, List[beanmachine.ppl.compiler.bmg_nodes.BMGNode]]]
class beanmachine.ppl.compiler.copy_and_replace.TransformAssessment(node_needs_transform, error_report)

Bases: tuple

error_report

Alias for field number 1

node_needs_transform

Alias for field number 0

beanmachine.ppl.compiler.copy_and_replace.copy_and_replace(bmg_original: beanmachine.ppl.compiler.bm_graph_builder.BMGraphBuilder, transformer_creator: Callable[[beanmachine.ppl.compiler.copy_and_replace.Cloner, beanmachine.ppl.compiler.sizer.Sizer], beanmachine.ppl.compiler.copy_and_replace.NodeTransformer]) Tuple[beanmachine.ppl.compiler.bm_graph_builder.BMGraphBuilder, beanmachine.ppl.compiler.error_report.ErrorReport]
beanmachine.ppl.compiler.copy_and_replace.flatten(inputs: List[Optional[Union[beanmachine.ppl.compiler.bmg_nodes.BMGNode, List[beanmachine.ppl.compiler.bmg_nodes.BMGNode]]]]) List[beanmachine.ppl.compiler.bmg_nodes.BMGNode]