Shape check input

Only Cuda and Tensor had C code with check on the input c_extract.
It doesn't check because I copied the code from CudaNdarray and it doesn't do that there.

Also I guess we could remove the check for the right class / None.  However that might be going a bit too far since it would be easy to crash.