Skip to content

Commit b3df081

Browse files
Req
1 parent 9069f00 commit b3df081

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/net.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,17 +2209,13 @@ int Extractor::input(int blob_index, const Mat& in)
22092209
const Mat& shape = d->net->blobs()[blob_index].shape;
22102210
if (shape.total())
22112211
{
2212-
if ((in.dims == 3 || in.dims == 4) && (shape.w != in.w || shape.h != in.h || shape.d != in.d || shape.c != in.c * in.elempack))
2213-
return -1;
2214-
2215-
if (in.dims == 2 && (shape.w != in.w || shape.h != in.h * in.elempack))
2216-
return -1;
2217-
2218-
if (in.dims == 1 && (shape.w != in.w * in.elempack))
2212+
const Mat& in_shape = in.shape();
2213+
if (shape.dims != in_shape.dims || shape.w != in_shape.w || shape.h != in_shape.h || shape.c != in_shape.c)
22192214
return -1;
22202215
}
22212216

22222217
d->blob_mats[blob_index] = in;
2218+
22232219
return 0;
22242220
}
22252221

0 commit comments

Comments
 (0)