Upgrade FDASSERT string format (#121)

* upgrade FDASSERT

* Add c_str() for reduce

* upgrade FDASSERT flag

* upgrade flags

* upgrade lu

* fix tests cmake

* Fix pybind FDASSERT
This commit is contained in:
Jack Zhou
2022-08-17 10:03:41 +08:00
committed by GitHub
parent 82868d2c4d
commit 13a3d6f9f5
15 changed files with 63 additions and 56 deletions

View File

@@ -95,12 +95,12 @@ void Transpose(const FDTensor& x, FDTensor* out,
size_t dims_size = dims.size();
FDASSERT(dims_size == x.shape.size(),
"The input tensor's dimension should be equal to the dims's size. "
"Expect dims size is %d, but receive %d.",
"Expect dims size is %lu, but receive %lu.",
x.shape.size(), dims_size);
std::vector<int> count(dims_size, 0);
for (size_t i = 0; i < dims_size; i++) {
FDASSERT(dims[i] >= 0,
"The dims should be greater than or equal to 0, but receive %d.",
"The dims should be greater than or equal to 0, but receive %lld.",
dims[i]);
FDASSERT(dims[i] < static_cast<int>(dims_size) && ++count[dims[i]] == 1,
"Each element of Attribute axis should be a unique value range "