pymc.SymbolicRandomVariable.do_constant_folding#

SymbolicRandomVariable.do_constant_folding(fgraph, node)#

Determine whether generic constant folding may evaluate the given node.

Return False to prevent generic constant folding from evaluating this node during compilation, even when all its inputs are constants. Graph-dependent decisions about rewrite ordering, consumers, and inplace opportunities belong in specialized rewrites. Such rewrites can use unconditional constant folding after deciding that materializing a node is worthwhile.

Parameters:
fgraphFunctionGraph

Function graph to which node belongs. This is passed in case the Op needs to inspect the graph to make its decision.

nodeApply

The node for which the constant folding determination is made.

Returns:
resbool