Sanitize with clang-format
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
da3c1f4b01
commit
2ef79b9c91
@ -38,12 +38,17 @@ class EnsureShapeOp : public XlaOpKernel {
|
||||
const TensorShape shape = ctx->InputShape(0);
|
||||
|
||||
// valiate shape
|
||||
OP_REQUIRES(ctx, expected_shape_.IsCompatibleWith(shape),
|
||||
errors::InvalidArgument("Shape of tensor ", this->def().input(0), " ", shape.DebugString(), " is not compatible with expected shape ", expected_shape_.DebugString(), "."));
|
||||
OP_REQUIRES(
|
||||
ctx, expected_shape_.IsCompatibleWith(shape),
|
||||
errors::InvalidArgument("Shape of tensor ", this->def().input(0), " ",
|
||||
shape.DebugString(),
|
||||
" is not compatible with expected shape ",
|
||||
expected_shape_.DebugString(), "."));
|
||||
|
||||
// If shape matches, outputs the tensor.
|
||||
ctx->SetOutput(0, ctx->Input(0));
|
||||
}
|
||||
|
||||
private:
|
||||
PartialTensorShape expected_shape_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user