BUG FIX: fixed over-eager type checking in scan_op.py

...m),

since GPU optimizations may change the actual type from TensorType to
CudaNdArray (but with correct dtype and ndim).