add identity tests from Ivo
update output and gradInput everytime the functions are run