@register_canonicalize
@gof.local_optimizer([T.abs_])
def local_abs_lift(node):
 if ((node.op == T.abs_) and node.inputs[0].owner):
  assert (node.nin == 1)
  if (node.inputs[0].owner.op == T.mul):
   return [T.mul(*[T.abs_(i) for i in node.inputs[0].owner.inputs])]
  if (node.inputs[0].owner.op == T.true_div):
   i = node.inputs[0].owner.inputs
   return [T.true_div(T.abs_(i[0]), T.abs_(i[1]))]

@ register_canonicalize @ gof . local_optimizer ( [ T . abs_ ] ) def local_abs_lift ( node ) : if ( ( node . op == T . abs_ ) and node . inputs [ 0 ] . owner ) : assert ( node . nin == 1 ) if ( node . inputs [ 0 ] . owner . op == T . mul ) : return [ T . mul ( * [ T . abs_ ( i ) for i in node . inputs [ 0 ] . owner . inputs ] ) ] if ( node . inputs [ 0 ] . owner . op == T . true_div ) : i = node . inputs [ 0 ] . owner . inputs return [ T . true_div ( T . abs_ ( i [ 0 ] ) , T . abs_ ( i [ 1 ] ) ) ]
move the abs toward the input .