cutorch compatibility for adagrad

Fixes #8 #18