pymc.SymbolicRandomVariable.do_constant_folding#
- SymbolicRandomVariable.do_constant_folding(fgraph, node)#
Determine whether constant folding should be performed for the given node.
This allows each Op to determine if it wants to be constant folded when all its inputs are constant. This allows it to choose where it puts its memory/speed trade-off. Also, it could make things faster as constants can’t be used for in-place operations (see
*IncSubtensor).- Parameters:
- fgraph
FunctionGraph Function graph to which node belongs. This is passed in case the Op needs to inspect the graph to make its decision.
- node
Apply The node for which the constant folding determination is made.
- fgraph
- Returns:
- resbool