Merge pull request #2355 from nouiz/cudnn_repair_r1

[CRASH] Repair crash with cudnn r-1 following the removing of struct_id
[CRASH] cudnn softmax r1
small code refactoring