Sanitize with clang-format -i --style=Google

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2018-01-01 23:51:59 +00:00
parent e71a40a16c
commit 8e6475f3fe

View File

@ -78,14 +78,19 @@ class DrawBoundingBoxesOp : public OpKernel {
} }
if (context->num_inputs() == 3) { if (context->num_inputs() == 3) {
const Tensor& colors_tensor = context->input(2); const Tensor& colors_tensor = context->input(2);
OP_REQUIRES(context, colors_tensor.shape().dims() == 2, errors::InvalidArgument("colors must be a 2-D matrix", colors_tensor.shape().DebugString())); OP_REQUIRES(context, colors_tensor.shape().dims() == 2,
OP_REQUIRES(context, colors_tensor.shape().dim_size(1) == 4, errors::InvalidArgument("colors must be n x 4 (RGBA)", colors_tensor.shape().DebugString())); errors::InvalidArgument("colors must be a 2-D matrix",
colors_tensor.shape().DebugString()));
OP_REQUIRES(context, colors_tensor.shape().dim_size(1) == 4,
errors::InvalidArgument("colors must be n x 4 (RGBA)",
colors_tensor.shape().DebugString()));
if (colors_tensor.NumElements() != 0) { if (colors_tensor.NumElements() != 0) {
color_table.clear(); color_table.clear();
auto colors = colors_tensor.matrix<float>(); auto colors = colors_tensor.matrix<float>();
for (int64 i = 0; i < colors.dimension(0); i++) { for (int64 i = 0; i < colors.dimension(0); i++) {
color_table.emplace_back(std::array<float, 4>{colors(i, 0), colors(i, 1), colors(i, 2), colors(i, 3)}); color_table.emplace_back(std::array<float, 4>{
colors(i, 0), colors(i, 1), colors(i, 2), colors(i, 3)});
} }
} }
} }