diff options
-rw-r--r-- | tensorflow/contrib/image/kernels/bipartite_match_op.cc | 2 | ||||
-rw-r--r-- | tensorflow/contrib/seq2seq/kernels/beam_search_ops.cc | 8 | ||||
-rw-r--r-- | tensorflow/core/kernels/colorspace_op.cc | 2 | ||||
-rw-r--r-- | tensorflow/core/kernels/non_max_suppression_op.cc | 5 | ||||
-rw-r--r-- | tensorflow/core/kernels/quantized_resize_bilinear_op.cc | 4 | ||||
-rw-r--r-- | tensorflow/core/kernels/random_crop_op.cc | 4 | ||||
-rw-r--r-- | tensorflow/core/kernels/resize_area_op.cc | 5 | ||||
-rw-r--r-- | tensorflow/core/kernels/resize_bicubic_op.cc | 10 | ||||
-rw-r--r-- | tensorflow/core/kernels/resize_bilinear_op.cc | 10 | ||||
-rw-r--r-- | tensorflow/core/kernels/resize_nearest_neighbor_op.cc | 8 | ||||
-rw-r--r-- | tensorflow/core/kernels/sample_distorted_bounding_box_op.cc | 6 | ||||
-rw-r--r-- | tensorflow/core/kernels/substr_op.cc | 20 |
12 files changed, 39 insertions, 45 deletions
diff --git a/tensorflow/contrib/image/kernels/bipartite_match_op.cc b/tensorflow/contrib/image/kernels/bipartite_match_op.cc index 7d207c388b..726adb0777 100644 --- a/tensorflow/contrib/image/kernels/bipartite_match_op.cc +++ b/tensorflow/contrib/image/kernels/bipartite_match_op.cc @@ -85,7 +85,7 @@ class BipartiteMatchOp : public OpKernel { context->allocate_output(1, TensorShape({num_input_columns}), &column_to_row_match_indices)); - typename TTypes<float, 2>::ConstTensor distance_mat = + TTypes<float, 2>::ConstTensor distance_mat = input_distance_mat.shaped<float, 2>( {num_input_rows, num_input_columns}); diff --git a/tensorflow/contrib/seq2seq/kernels/beam_search_ops.cc b/tensorflow/contrib/seq2seq/kernels/beam_search_ops.cc index 64973ccccd..dfa12e873a 100644 --- a/tensorflow/contrib/seq2seq/kernels/beam_search_ops.cc +++ b/tensorflow/contrib/seq2seq/kernels/beam_search_ops.cc @@ -80,12 +80,12 @@ class GatherTreeOp : public OpKernel { max_sequence_lengths.shape().DebugString())); Tensor* beams; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, step_ids_shape, &beams)); - typename TTypes<T, 3>::ConstTensor step_ids_t = step_ids.tensor<T, 3>(); - typename TTypes<T, 3>::ConstTensor parent_ids_t = parent_ids.tensor<T, 3>(); + typename TTypes<T, 3>::ConstTensor step_ids_t(step_ids.tensor<T, 3>()); + typename TTypes<T, 3>::ConstTensor parent_ids_t(parent_ids.tensor<T, 3>()); typename TTypes<int32>::ConstVec max_seq_lens_t = max_sequence_lengths.vec<int32>(); - typename TTypes<T>::ConstScalar end_token_t = end_token.scalar<T>(); - typename TTypes<T, 3>::Tensor beams_t = beams->tensor<T, 3>(); + typename TTypes<T>::ConstScalar end_token_t(end_token.scalar<T>()); + typename TTypes<T, 3>::Tensor beams_t(beams->tensor<T, 3>()); const T end_token_value = end_token_t(); functor::GatherTree<Device, T>()(ctx, device, step_ids_t, parent_ids_t, max_seq_lens_t, end_token_value, beams_t); diff --git a/tensorflow/core/kernels/colorspace_op.cc b/tensorflow/core/kernels/colorspace_op.cc index 9cc2e67bbe..f4402a245d 100644 --- a/tensorflow/core/kernels/colorspace_op.cc +++ b/tensorflow/core/kernels/colorspace_op.cc @@ -71,7 +71,7 @@ class RGBToHSVOp : public OpKernel { TensorShape({input_data.dimension(0)}), &trange)); - typename TTypes<T, 1>::Tensor range = trange.tensor<T, 1>(); + typename TTypes<T, 1>::Tensor range(trange.tensor<T, 1>()); functor::RGBToHSV<Device, T>()(context->eigen_device<Device>(), input_data, range, output_data); diff --git a/tensorflow/core/kernels/non_max_suppression_op.cc b/tensorflow/core/kernels/non_max_suppression_op.cc index 5d28b87e6b..903b898d0a 100644 --- a/tensorflow/core/kernels/non_max_suppression_op.cc +++ b/tensorflow/core/kernels/non_max_suppression_op.cc @@ -105,7 +105,7 @@ void DoNonMaxSuppressionOp(OpKernelContext* context, const Tensor& boxes, } const int output_size = std::min(max_output_size.scalar<int>()(), num_boxes); - typename TTypes<float, 2>::ConstTensor boxes_data = boxes.tensor<float, 2>(); + TTypes<float, 2>::ConstTensor boxes_data = boxes.tensor<float, 2>(); std::vector<float> scores_data(num_boxes); std::copy_n(scores.flat<float>().data(), num_boxes, scores_data.begin()); @@ -138,8 +138,7 @@ void DoNonMaxSuppressionOp(OpKernelContext* context, const Tensor& boxes, Tensor* output = nullptr; TensorShape output_shape({static_cast<int>(selected.size())}); OP_REQUIRES_OK(context, context->allocate_output(0, output_shape, &output)); - typename TTypes<int, 1>::Tensor selected_indices_data = - output->tensor<int, 1>(); + TTypes<int, 1>::Tensor selected_indices_data = output->tensor<int, 1>(); std::copy_n(selected.begin(), selected.size(), selected_indices_data.data()); } diff --git a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc index fb2faede2f..9a1dcd0d49 100644 --- a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc +++ b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc @@ -697,8 +697,8 @@ class QuantizedResizeBilinearOp : public OpKernel { // Return if the output is empty. if (st.output->NumElements() == 0) return; - typename TTypes<T, 4>::ConstTensor image_data = input.tensor<T, 4>(); - typename TTypes<T, 4>::Tensor output_data = st.output->tensor<T, 4>(); + typename TTypes<T, 4>::ConstTensor image_data(input.tensor<T, 4>()); + typename TTypes<T, 4>::Tensor output_data(st.output->tensor<T, 4>()); ResizeBilinear<T>(image_data, st.height_scale, st.width_scale, in_min, in_max, &output_data); diff --git a/tensorflow/core/kernels/random_crop_op.cc b/tensorflow/core/kernels/random_crop_op.cc index 554909760a..b89bda4769 100644 --- a/tensorflow/core/kernels/random_crop_op.cc +++ b/tensorflow/core/kernels/random_crop_op.cc @@ -92,8 +92,8 @@ class RandomCropOp : public OpKernel { // TODO(shlens): Do this more efficiently with memcpy once padding is // available for smaller images. - typename TTypes<T, 3>::ConstTensor input_data = input.tensor<T, 3>(); - typename TTypes<T, 3>::Tensor output_data = output->tensor<T, 3>(); + typename TTypes<T, 3>::ConstTensor input_data(input.tensor<T, 3>()); + typename TTypes<T, 3>::Tensor output_data(output->tensor<T, 3>()); for (int y = 0; y < target_height; ++y) { for (int x = 0; x < target_width; ++x) { diff --git a/tensorflow/core/kernels/resize_area_op.cc b/tensorflow/core/kernels/resize_area_op.cc index ada50dfb70..98b8a0df28 100644 --- a/tensorflow/core/kernels/resize_area_op.cc +++ b/tensorflow/core/kernels/resize_area_op.cc @@ -149,7 +149,7 @@ class ResizeAreaOp : public OpKernel { if (!context->status().ok()) return; - typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); + typename TTypes<T, 4>::ConstTensor input_data(input.tensor<T, 4>()); // Precompute values used when iterating over x coordinates within a row. // Note that it may be useful to cache x_interps for a given @@ -190,8 +190,7 @@ class ResizeAreaOp : public OpKernel { void ComputeLoop(const ImageResizerState& st, const std::vector<CachedInterpolation>& x_interps, typename TTypes<T, 4>::ConstTensor input_data) { - typename TTypes<float, 4>::Tensor output_data = - st.output->tensor<float, 4>(); + TTypes<float, 4>::Tensor output_data = st.output->tensor<float, 4>(); // When using this algorithm for downsizing, the target pixel value is the // weighted average of all the source pixels. The weight is determined by diff --git a/tensorflow/core/kernels/resize_bicubic_op.cc b/tensorflow/core/kernels/resize_bicubic_op.cc index 86e61bbcef..65014b6c44 100644 --- a/tensorflow/core/kernels/resize_bicubic_op.cc +++ b/tensorflow/core/kernels/resize_bicubic_op.cc @@ -480,9 +480,8 @@ class ResizeBicubicOp : public OpKernel { if (!context->status().ok()) return; - typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); - typename TTypes<float, 4>::Tensor output_data = - st.output->tensor<float, 4>(); + typename TTypes<T, 4>::ConstTensor input_data(input.tensor<T, 4>()); + TTypes<float, 4>::Tensor output_data = st.output->tensor<float, 4>(); interpolate_with_caching<T>(input_data, st, output_data); } @@ -510,9 +509,8 @@ class ResizeBicubicOpGrad : public OpKernel { if (!context->status().ok()) return; - typename TTypes<float, 4>::ConstTensor input_grad = - input.tensor<float, 4>(); - typename TTypes<T, 4>::Tensor output_grad = st.output->tensor<T, 4>(); + TTypes<float, 4>::ConstTensor input_grad = input.tensor<float, 4>(); + typename TTypes<T, 4>::Tensor output_grad(st.output->tensor<T, 4>()); ResizeBicubicGrad<T>(input_grad, st, output_grad); } diff --git a/tensorflow/core/kernels/resize_bilinear_op.cc b/tensorflow/core/kernels/resize_bilinear_op.cc index d9cb993a4b..dde59e8e74 100644 --- a/tensorflow/core/kernels/resize_bilinear_op.cc +++ b/tensorflow/core/kernels/resize_bilinear_op.cc @@ -51,9 +51,8 @@ class ResizeBilinearOp : public OpKernel { // Return if the output is empty. if (st.output->NumElements() == 0) return; - typename TTypes<T, 4>::ConstTensor image_data = input.tensor<T, 4>(); - typename TTypes<float, 4>::Tensor output_data = - st.output->tensor<float, 4>(); + typename TTypes<T, 4>::ConstTensor image_data(input.tensor<T, 4>()); + TTypes<float, 4>::Tensor output_data = st.output->tensor<float, 4>(); functor::ResizeBilinear<Device, T>()(context->eigen_device<Device>(), image_data, st.height_scale, @@ -258,9 +257,8 @@ class ResizeBilinearOpGrad : public OpKernel { if (!context->status().ok()) return; - typename TTypes<float, 4>::ConstTensor input_grad = - input.tensor<float, 4>(); - typename TTypes<T, 4>::Tensor output_grad = st.output->tensor<T, 4>(); + TTypes<float, 4>::ConstTensor input_grad = input.tensor<float, 4>(); + typename TTypes<T, 4>::Tensor output_grad(st.output->tensor<T, 4>()); functor::ResizeBilinearGrad<Device, T>()(context->eigen_device<Device>(), input_grad, st.height_scale, diff --git a/tensorflow/core/kernels/resize_nearest_neighbor_op.cc b/tensorflow/core/kernels/resize_nearest_neighbor_op.cc index bfd29b7ec8..8ec526c2b2 100644 --- a/tensorflow/core/kernels/resize_nearest_neighbor_op.cc +++ b/tensorflow/core/kernels/resize_nearest_neighbor_op.cc @@ -56,8 +56,8 @@ class ResizeNearestNeighborOp : public OpKernel { // Return if the output is empty. if (st.output->NumElements() == 0) return; - typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); - typename TTypes<T, 4>::Tensor output_data = st.output->tensor<T, 4>(); + typename TTypes<T, 4>::ConstTensor input_data(input.tensor<T, 4>()); + typename TTypes<T, 4>::Tensor output_data(st.output->tensor<T, 4>()); bool status; if (align_corners_) { @@ -162,8 +162,8 @@ class ResizeNearestNeighborOpGrad : public OpKernel { // Return if the output is empty. if (output->NumElements() == 0) return; - typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); - typename TTypes<T, 4>::Tensor output_data = output->tensor<T, 4>(); + typename TTypes<T, 4>::ConstTensor input_data(input.tensor<T, 4>()); + typename TTypes<T, 4>::Tensor output_data(output->tensor<T, 4>()); const float height_scale = CalculateResizeScale(out_height, in_height, align_corners_); diff --git a/tensorflow/core/kernels/sample_distorted_bounding_box_op.cc b/tensorflow/core/kernels/sample_distorted_bounding_box_op.cc index 44a817a5c7..c0fde8042e 100644 --- a/tensorflow/core/kernels/sample_distorted_bounding_box_op.cc +++ b/tensorflow/core/kernels/sample_distorted_bounding_box_op.cc @@ -387,9 +387,9 @@ class SampleDistortedBoundingBoxV2Op : public OpKernel { OP_REQUIRES_OK( context, context->allocate_output(2, TensorShape({1, 1, 4}), &bboxes)); - typename TTypes<T, 1>::Tensor begin_data = begin->tensor<T, 1>(); - typename TTypes<T, 1>::Tensor size_data = size->tensor<T, 1>(); - typename TTypes<float, 3>::Tensor bboxes_data = bboxes->tensor<float, 3>(); + typename TTypes<T, 1>::Tensor begin_data(begin->tensor<T, 1>()); + typename TTypes<T, 1>::Tensor size_data(size->tensor<T, 1>()); + TTypes<float, 3>::Tensor bboxes_data = bboxes->tensor<float, 3>(); begin_data(0) = T(offset_height); size_data(0) = T(target_height); diff --git a/tensorflow/core/kernels/substr_op.cc b/tensorflow/core/kernels/substr_op.cc index e29f67297f..22e45918a0 100644 --- a/tensorflow/core/kernels/substr_op.cc +++ b/tensorflow/core/kernels/substr_op.cc @@ -115,7 +115,7 @@ class SubstrOp : public OpKernel { Tensor input_buffer; OP_REQUIRES_OK(context, context->allocate_temp( DT_STRING, output_shape, &input_buffer)); - typename TTypes<string, 1>::Tensor input_bcast = + TTypes<string, 1>::Tensor input_bcast = input_buffer.shaped<string, 1>(bcast.result_shape()); input_bcast = input.broadcast(BCast::ToIndexArray<1>(bcast.x_bcast())); @@ -125,8 +125,8 @@ class SubstrOp : public OpKernel { OP_REQUIRES_OK(context, context->allocate_temp(DataTypeToEnum<T>::v(), output_shape, &pos_buffer)); - typename TTypes<T, 1>::Tensor pos_bcast = - pos_buffer.shaped<T, 1>(bcast.result_shape()); + typename TTypes<T, 1>::Tensor pos_bcast( + pos_buffer.shaped<T, 1>(bcast.result_shape())); pos_bcast = pos_shaped.broadcast(BCast::ToIndexArray<1>(bcast.y_bcast())); @@ -135,8 +135,8 @@ class SubstrOp : public OpKernel { OP_REQUIRES_OK(context, context->allocate_temp(DataTypeToEnum<T>::v(), output_shape, &len_buffer)); - typename TTypes<T, 1>::Tensor len_bcast = - len_buffer.shaped<T, 1>(bcast.result_shape()); + typename TTypes<T, 1>::Tensor len_bcast( + len_buffer.shaped<T, 1>(bcast.result_shape())); len_bcast = len_shaped.broadcast(BCast::ToIndexArray<1>(bcast.y_bcast())); @@ -164,7 +164,7 @@ class SubstrOp : public OpKernel { Tensor input_buffer; OP_REQUIRES_OK(context, context->allocate_temp( DT_STRING, output_shape, &input_buffer)); - typename TTypes<string, 2>::Tensor input_bcast = + TTypes<string, 2>::Tensor input_bcast = input_buffer.shaped<string, 2>(bcast.result_shape()); input_bcast = input.broadcast(BCast::ToIndexArray<2>(bcast.x_bcast())); @@ -174,8 +174,8 @@ class SubstrOp : public OpKernel { OP_REQUIRES_OK(context, context->allocate_temp(DataTypeToEnum<T>::v(), output_shape, &pos_buffer)); - typename TTypes<T, 2>::Tensor pos_bcast = - pos_buffer.shaped<T, 2>(bcast.result_shape()); + typename TTypes<T, 2>::Tensor pos_bcast( + pos_buffer.shaped<T, 2>(bcast.result_shape())); pos_bcast = pos_shaped.broadcast(BCast::ToIndexArray<2>(bcast.y_bcast())); @@ -184,8 +184,8 @@ class SubstrOp : public OpKernel { OP_REQUIRES_OK(context, context->allocate_temp(DataTypeToEnum<T>::v(), output_shape, &len_buffer)); - typename TTypes<T, 2>::Tensor len_bcast = - len_buffer.shaped<T, 2>(bcast.result_shape()); + typename TTypes<T, 2>::Tensor len_bcast( + len_buffer.shaped<T, 2>(bcast.result_shape())); len_bcast = len_shaped.broadcast(BCast::ToIndexArray<2>(bcast.y_bcast())); |