set_optimization

dragon.autograph.set_optimization(level=1)[source]

Set the optimization for graph ir.

Following levels are defined (default=3):

  • level = 0: Do nothing.
  • level = 1: Prune the redundant nodes.
  • level = 2: Add the inplace to outputs.
  • level = 3: Allocate the buffer for outputs.
Parameters:
  • level (int, optional, default=3) – The optimization level.