message: Minor optimization of conv_ops.
  If data_format is NCHW, and the computation is done
  on GPU, the temporary tensor transformed_output is not
  needed. One can use directly the output tensor. This
  leaves more memory for the scratch allocator, possibly
  improving performance.
  I also fixed several style issues in conv_ops.cc reported
  by clang-format.
diff: @@ -315,19 +315,18 @@ class Conv2DOp : public BinaryOp<T> {
  filter.shape().DebugString()));
  for (int i = 0; i < 3; i++) {
  - OP_REQUIRES(
  - context,
  - FastBoundsCheck(filter.dim_size(i), std::numeric_limits<int>::max()),
  + OP_REQUIRES(context, FastBoundsCheck(filter.dim_size(i),
  + std::numeric_limits<int>::max()),
  errors::InvalidArgument("filter too large"));
  }
  // The last dimension for input is in_depth. It must be the same as the
  // filter's in_depth.
  const int64 in_depth = GetTensorDim(input, data_format_, 'C');
  - OP_REQUIRES(context, in_depth == filter.dim_size(2),
  - errors::InvalidArgument(
  - "input and filter must have the same depth: ", in_depth,
  - " vs ", filter.dim_size(2)));
  + OP_REQUIRES(
  + context, in_depth == filter.dim_size(2),
  + errors::InvalidArgument("input and filter must have the same depth: ",
  + in_depth, " vs ", filter.dim_size(2)));
  // The last dimension for filter is out_depth.
  const int out_depth = static_cast<int>(filter.dim_size(3));
  @@ -335,9 +334,8 @@ class Conv2DOp : public BinaryOp<T> {
  // The second dimension for input is rows/height.
  // The first dimension for filter is rows/height.
  const int64 input_rows_raw = GetTensorDim(input, data_format_, 'H');
  - OP_REQUIRES(
  - context,
  - FastBoundsCheck(input_rows_raw, std::numeric_limits<int>::max()),
  + OP_REQUIRES(context, FastBoundsCheck(input_rows_raw,
  + std::numeric_limits<int>::max()),
  errors::InvalidArgument("Input rows too large"));
  const int input_rows = static_cast<int>(input_rows_raw);
  const int filter_rows = static_cast<int>(filter.dim_size(0));
  @@ -345,9 +343,8 @@ class Conv2DOp : public BinaryOp<T> {
  // The third dimension for input is columns/width.
  // The second dimension for filter is columns/width.
  const int64 input_cols_raw = GetTensorDim(input, data_format_, 'W');
  - OP_REQUIRES(
  - context,
  - FastBoundsCheck(input_cols_raw, std::numeric_limits<int>::max()),
  + OP_REQUIRES(context, FastBoundsCheck(input_cols_raw,
  + std::numeric_limits<int>::max()),
  errors::InvalidArgument("Input cols too large"));
  const int input_cols = static_cast<int>(input_cols_raw);
  const int filter_cols = static_cast<int>(filter.dim_size(1));
  @@ -663,11 +660,14 @@ void LaunchConv2DOp<GPUDevice, T>::operator()(
  To32Bit(transformed_filter.tensor<T, 4>()));
  Tensor transformed_output;
  + if (data_format == FORMAT_NHWC)
  OP_REQUIRES_OK(
  ctx, ctx->allocate_temp(DataTypeToEnum<T>::value,
  - ShapeFromFormat(FORMAT_NCHW, out_batch, out_rows,
  - out_cols, out_depths),
  + ShapeFromFormat(FORMAT_NCHW, out_batch,
  + out_rows, out_cols, out_depths),
  &transformed_output));
  + else
  + transformed_output = *output;
  auto input_ptr = AsDeviceMemory(input.template flat<T>().data(),
  input.template flat<T>().size());
  @@ -772,8 +772,6 @@ void LaunchConv2DOp<GPUDevice, T>::operator()(
  ctx->eigen_device<GPUDevice>(),
  const_cast<const Tensor&>(transformed_output).tensor<T, 4>(),
  output->tensor<T, 4>());
  - } else {
  - *output = transformed_output;
  }
  }
  