.xoptim.order_optim

class experimental_experiment.xoptim.order_optim.OrderAlgorithm(*values)[source]

Defines the possible order algorithm.

  • NONE: does not change anything

  • RANDOM: random order

  • SHAPE: moves every shape node just behind the node producing its input

class experimental_experiment.xoptim.order_optim.OrderOptimization(builder: GraphBuilder, algorithm: OrderAlgorithm = OrderAlgorithm.NONE, verbose: int = 0)[source]

Optimizes the order of computation. It tries to minimize the distance between a producer and the consumer or a results. The idea is to reduce the memory usage.

Parameters:
  • builder – GraphBuilder holding the model

  • algorithm – to apply

  • verbose – verbosity

optimize() List[Dict[str, Any]][source]

Optimizes the model inplace. It optimizes the model in the builder itself by switching nodes.

random_order()[source]

Moves nodes by random.

shape_order()[source]

Moves shape right after the node it consumes is created.