aeppl.scan.MeasurableScan.do_constant_folding#

MeasurableScan.do_constant_folding(fgraph, node)#

Determine whether or not 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
  • node (Apply) – The node for which the constant folding determination is made.

  • fgraph (FunctionGraph) –

Returns

res

Return type

bool