@@ -19,11 +19,11 @@ limitations under the License.
1919#define EIGEN_USE_GPU
2020#endif // GOOGLE_CUDA
2121
22+ #include " tensorflow_addons/custom_ops/image/cc/kernels/image_projective_transform_op.h"
2223#include " tensorflow/core/framework/op_kernel.h"
2324#include " tensorflow/core/framework/register_types.h"
2425#include " tensorflow/core/framework/types.h"
2526#include " tensorflow/core/platform/types.h"
26- #include " tensorflow_addons/custom_ops/image/cc/kernels/image_projective_transform_op.h"
2727
2828namespace tensorflow {
2929
@@ -73,12 +73,11 @@ class ImageProjectiveTransform : public OpKernel {
7373 const Tensor& transform_t = ctx->input (1 );
7474 OP_REQUIRES (ctx, images_t .shape ().dims () == 4 ,
7575 errors::InvalidArgument (" Input images must have rank 4" ));
76- OP_REQUIRES (ctx,
77- (TensorShapeUtils::IsMatrix (transform_t .shape ()) &&
78- (transform_t .dim_size (0 ) == images_t .dim_size (0 ) ||
79- transform_t .dim_size (0 ) == 1 ) &&
80- transform_t .dim_size (1 ) ==
81- ProjectiveGenerator<Device, T>::kNumParameters ),
76+ OP_REQUIRES (ctx, (TensorShapeUtils::IsMatrix (transform_t .shape ()) &&
77+ (transform_t .dim_size (0 ) == images_t .dim_size (0 ) ||
78+ transform_t .dim_size (0 ) == 1 ) &&
79+ transform_t .dim_size (1 ) ==
80+ ProjectiveGenerator<Device, T>::kNumParameters ),
8281 errors::InvalidArgument (
8382 " Input transform should be num_images x 8 or 1 x 8" ));
8483
@@ -106,9 +105,8 @@ class ImageProjectiveTransform : public OpKernel {
106105
107106 Tensor* output_t ;
108107 OP_REQUIRES_OK (ctx, ctx->allocate_output (
109- 0 ,
110- TensorShape ({images_t .dim_size (0 ), out_height,
111- out_width, images_t .dim_size (3 )}),
108+ 0 , TensorShape ({images_t .dim_size (0 ), out_height,
109+ out_width, images_t .dim_size (3 )}),
112110 &output_t ));
113111 auto output = output_t ->tensor <T, 4 >();
114112 auto images = images_t .tensor <T, 4 >();
0 commit comments