Fix softmaxlayer test and make a gradient test.