def optimize(expr, data):
 leaf = expr._leaves()[0]
 return expr._subs({leaf: symbol('newname', leaf.dshape)})

def optimize ( expr , data ) : leaf = expr . _leaves ( ) [ 0 ] return expr . _subs ( { leaf : symbol ( 'newname' , leaf . dshape ) } )
the context hint can be used to perform an static optimization based on the context given .