[WIP]Shape check input

Only Cuda and Tensor had C code with check on the input c_extract.
Use check_input in the example. You should also modify the tutorial documentation file with the same diff.