Skip to content

Commit

Permalink
check c>0 only when data_num != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed Aug 22, 2019
1 parent bcfab34 commit 7af8be7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dabnn/mat.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ inline Mat::Mat(int _n, int _w, int _h, int _c, void *_data, DataType data_type,
", ", h, ", ", c);
}
elemsize = data_type == DataType::Float ? sizeof(float) : sizeof(uint64_t);
BNN_ASSERT(c > 0, c);
std::stringstream ss;
ss << "Not align, w: " << w << ", c: " << c << ", elemsize: " << elemsize;
BNN_ASSERT(!require_align || w * c == 1 || w * c * elemsize % 16 == 0,
Expand All @@ -283,7 +282,10 @@ inline Mat::Mat(int _n, int _w, int _h, int _c, void *_data, DataType data_type,
} else {
hstep = w * c;
}
BNN_ASSERT(hstep > 0, hstep);
if (data_num == 0) {
BNN_ASSERT(c > 0, c);
BNN_ASSERT(hstep > 0, hstep);
}

external_memory = true;
}
Expand Down

0 comments on commit 7af8be7

Please sign in to comment.