if (!padDescriptorsIfRequired && descriptors.shape(1) != expectedByteCount) {
throwstd::runtime_error("Incompatible buffer shape for descriptors, dimension 0: number of descriptors, dimension 1: " + std::to_string(expectedByteCount));
}
if (padDescriptorsIfRequired && descriptors.shape(1) > expectedByteCount) {
throwstd::runtime_error("Incompatible buffer shape for descriptors, dimension 0: number of descriptors, dimension 1: <=" + std::to_string(expectedByteCount));