sigmoid layer cpu and gpu code