parameters: (block)
docstring: Only apply the optimization if the block is flat,
      i.e, it does not contain any op which contains a sub-block.
      TODO:
      Removing transposes and transpose compliments requires re-running
      type inference for the set of ops in between the fused transpose ops,
      which is simpler to do when all the ops in the block are free of sub blocks.
      The case of transpose fusion with sub-block containing ops needs to be handled with more care and test cases.
docstring_summary: Only apply the optimization if the block is flat,
      i.e, it does not contain any op which contains a sub-block.
      TODO:
      Removing transposes and transpose compliments requires re-running
      type inference for the set of ops in between the fused transpose ops,
      which is simpler to do when all the ops in the block are free of sub blocks.
      The case of transpose fusion with sub-block containing ops needs to be handled with more care and test cases.
docstring_tokens: Only apply the optimization if the block is flat i . e it does not contain any op which contains a sub - block . TODO : Removing transposes and transpose compliments requires re - running type inference for the set of ops in between the fused transpose ops which is simpler to do when all the ops in the block are free of sub blocks . The case of transpose fusion with sub - block containing ops needs to be handled with more care and test cases .
function: def reduce_transposes_block(block):
      """
      Only apply the optimization if the block is flat,
      i.e, it does not contain any op which contains a sub-block.
      TODO:
      Removing transposes and transpose compliments requires re-running
      type inference for the set of ops in between the fused transpose ops,
      which is simpler to do when all the ops in the block are free of sub blocks.
      The case of transpose fusion with sub-block containing ops needs to be handled with more care and test cases.
      """
      for op in list(block.operations):
          if len(op.blocks) > 0:
              return
  
      opt_transposes = TransposeOptimization(block)
      opt_transposes.block_traversal()
      opt_transposes.apply_transform()
function_tokens: def reduce_transposes_block ( block ) : for op in list ( block . operations ) : if len ( op . blocks ) > 0 : return opt_transposes = TransposeOptimization ( block ) opt_transposes . block_traversal ( ) opt_transposes . apply_transform ( )