Possible extra memory allocation in softmax

This is just to remove the unnecessary extra memory allocation in the softmax layer.