Add input data shape test to avoid out of memory Jacobians