RgbToYuv & YuvToRgb skip empty arrays

Signed-off-by: raver119 <raver119@gmail.com>
master
raver119 2019-12-24 18:45:54 +03:00
parent 75123b0a4c
commit fc760de348
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,10 @@ CONFIGURABLE_OP_IMPL(rgb_to_yuv, 1, 1, true, 0, 0) {
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);
// just skip op if input is empty
if (input->isEmpty())
return Status::OK();
const int rank = input->rankOf();
const int argSize = block.getIArguments()->size();
const int dimC = argSize > 0 ? (INT_ARG(0) >= 0 ? INT_ARG(0) : INT_ARG(0) + rank) : rank - 1;

View File

@ -31,6 +31,10 @@ CONFIGURABLE_OP_IMPL(yuv_to_rgb, 1, 1, true, 0, 0) {
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);
// just skip op if input is empty
if (input->isEmpty())
return Status::OK();
const int rank = input->rankOf();
const int argSize = block.getIArguments()->size();
const int dimC = argSize > 0 ? (INT_ARG(0) >= 0 ? INT_ARG(0) : INT_ARG(0) + rank) : rank - 1;