fix bug in sparse layer when cpu only