diff options
Diffstat (limited to 'tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc')
-rw-r--r-- | tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc b/tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc index 75146b28e6..254475db46 100644 --- a/tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc +++ b/tensorflow/core/kernels/crop_and_resize_op_gpu.cu.cc @@ -88,26 +88,26 @@ __global__ void CropAndResizeKernel( const int right_x_index = ceilf(in_x); const float x_lerp = in_x - left_x_index; - const float top_left( + const float top_left(static_cast<float>( image_ptr[((b_in * image_height + top_y_index) * image_width + left_x_index) * depth + - d]); - const float top_right( + d])); + const float top_right(static_cast<float>( image_ptr[((b_in * image_height + top_y_index) * image_width + right_x_index) * depth + - d]); - const float bottom_left( + d])); + const float bottom_left(static_cast<float>( image_ptr[((b_in * image_height + bottom_y_index) * image_width + left_x_index) * depth + - d]); - const float bottom_right( + d])); + const float bottom_right(static_cast<float>( image_ptr[((b_in * image_height + bottom_y_index) * image_width + right_x_index) * depth + - d]); + d])); const float top = top_left + (top_right - top_left) * x_lerp; const float bottom = bottom_left + (bottom_right - bottom_left) * x_lerp; crops_ptr[out_idx] = top + (bottom - top) * y_lerp; @@ -258,26 +258,26 @@ __global__ void CropAndResizeBackpropBoxesKernel( const int right_x_index = ceilf(in_x); const float x_lerp = in_x - left_x_index; - const float top_left = + const float top_left(static_cast<float>( image_ptr[((b_in * image_height + top_y_index) * image_width + left_x_index) * depth + - d]; - const float top_right = + d])); + const float top_right(static_cast<float>( image_ptr[((b_in * image_height + top_y_index) * image_width + right_x_index) * depth + - d]; - const float bottom_left = + d])); + const float bottom_left(static_cast<float>( image_ptr[((b_in * image_height + bottom_y_index) * image_width + left_x_index) * depth + - d]; - const float bottom_right = + d])); + const float bottom_right(static_cast<float>( image_ptr[((b_in * image_height + bottom_y_index) * image_width + right_x_index) * depth + - d]; + d])); // Compute the image gradient. float image_grad_y = (1 - x_lerp) * (bottom_left - top_left) + @@ -436,7 +436,7 @@ struct CropAndResizeBackpropBoxes<GPUDevice, T> { template struct CropAndResizeBackpropImage<GPUDevice, T>; \ template struct CropAndResizeBackpropBoxes<GPUDevice, T>; -TF_CALL_float(DEFINE_GPU_SPECS); +TF_CALL_GPU_NUMBER_TYPES(DEFINE_GPU_SPECS); #undef DEFINE_GPU_SPECS |