Fix opt error/skip in scan, add Shape.c_code()

News.txt
- Add Shape.c_code (Fred)
- Fix opt error/skiped with scan and hard_sigmoid.

Not news:
- fix crash on osx.