def is_exp(var):
 neg = False
 neg_info = is_neg(var)
 if (neg_info is not None):
  neg = True
  var = neg_info
 if (var.owner and (var.owner.op == tensor.exp)):
  return (neg, var.owner.inputs[0])

def is_exp ( var ) : neg = False neg_info = is_neg ( var ) if ( neg_info is not None ) : neg = True var = neg_info if ( var . owner and ( var . owner . op == tensor . exp ) ) : return ( neg , var . owner . inputs [ 0 ] )
match a variable with either of the exp(x) or -exp(x) patterns .