|
|
@@ -32,6 +32,10 @@ DecodeOp::DecodeOp(bool is_rgb_format) : is_rgb_format_(is_rgb_format) { |
|
|
|
|
|
|
|
|
Status DecodeOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) { |
|
|
Status DecodeOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<Tensor> *output) { |
|
|
IO_CHECK(input, output); |
|
|
IO_CHECK(input, output); |
|
|
|
|
|
// check the input tensor shape |
|
|
|
|
|
if (input->Rank() != 1) { |
|
|
|
|
|
RETURN_STATUS_UNEXPECTED("DecodeOp error: invalid input shape, only support 1D input."); |
|
|
|
|
|
} |
|
|
if (is_rgb_format_) { // RGB colour mode |
|
|
if (is_rgb_format_) { // RGB colour mode |
|
|
return Decode(input, output); |
|
|
return Decode(input, output); |
|
|
} else { // BGR colour mode |
|
|
} else { // BGR colour mode |
|
|
|