I used check_arrays( ccontiguous = True) to do this becase we need to check for the sparse case in which we want to make the X.data contiguous. The check_arrays function does this.