gradient calculator can deal with max operator and iterable mode