Skip to content

Commit 02ed0a1

Browse files
committed
DTensor<T>::parseFromTextFile throws invalid_argument if T is unsupported
1 parent 04e0e8b commit 02ed0a1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/tensor.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,9 @@ data_t<T> vectorFromFile(std::string path_to_file) {
629629
vecDataFromFile[i] = std::stoull(line.c_str());
630630
} else if constexpr (std::is_same_v<T, size_t>) {
631631
sscanf(line.c_str(), "%zu", &vecDataFromFile[i]);
632+
} else {
633+
throw std::invalid_argument("data type not supported");
632634
}
633-
// todo
634635

635636
if (++i == numElements) break;
636637
}

0 commit comments

Comments
 (0)