diff --git a/tensorflow/core/common_runtime/device_set_test.cc b/tensorflow/core/common_runtime/device_set_test.cc index 1b80a5b697f..4e58951361d 100644 --- a/tensorflow/core/common_runtime/device_set_test.cc +++ b/tensorflow/core/common_runtime/device_set_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/common_runtime/device_set.h" -#include "tensorflow/core/public/status.h" #include +#include "tensorflow/core/public/status.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/common_runtime/direct_session.cc b/tensorflow/core/common_runtime/direct_session.cc index 7727b828eda..7907803a0f8 100644 --- a/tensorflow/core/common_runtime/direct_session.cc +++ b/tensorflow/core/common_runtime/direct_session.cc @@ -93,7 +93,7 @@ void SchedClosure(std::function c) { } // namespace DirectSession::DirectSession(const SessionOptions& options, - const DeviceMgr* device_mgr) + const DeviceMgr* device_mgr) : options_(options), device_mgr_(device_mgr), cancellation_manager_(new CancellationManager()) { @@ -155,9 +155,9 @@ Status DirectSession::ExtendLocked(const GraphDef& graph) { } Status DirectSession::Run(const std::vector>& inputs, - const std::vector& output_names, - const std::vector& target_nodes, - std::vector* outputs) { + const std::vector& output_names, + const std::vector& target_nodes, + std::vector* outputs) { { mutex_lock l(graph_def_lock_); if (!graph_created_) { @@ -379,10 +379,10 @@ void DirectSession::RestoreStatefulNodes(Graph* graph) { } } -Status DirectSession::CreateGraphs(gtl::ArraySlice feeds, - gtl::ArraySlice fetches, - gtl::ArraySlice target_nodes, - std::unordered_map* outputs) { +Status DirectSession::CreateGraphs( + gtl::ArraySlice feeds, gtl::ArraySlice fetches, + gtl::ArraySlice target_nodes, + std::unordered_map* outputs) { Graph graph(OpRegistry::Global()); GraphConstructorOptions opts; @@ -462,8 +462,7 @@ Status DirectSession::CreateGraphs(gtl::ArraySlice feeds, // allow. device_opts.allow_internal_ops = true; device_opts.expect_device_spec = true; - Status s = - ConvertGraphDefToGraph(device_opts, graph_def, device_graph); + Status s = ConvertGraphDefToGraph(device_opts, graph_def, device_graph); if (!s.ok()) { delete device_graph; // Also delete other graphs created during the loop. diff --git a/tensorflow/core/common_runtime/direct_session.h b/tensorflow/core/common_runtime/direct_session.h index 6a2d58b0817..649fb4340ce 100644 --- a/tensorflow/core/common_runtime/direct_session.h +++ b/tensorflow/core/common_runtime/direct_session.h @@ -6,17 +6,17 @@ #include #include -#include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/common_runtime/device_mgr.h" #include "tensorflow/core/common_runtime/device_set.h" #include "tensorflow/core/common_runtime/executor.h" #include "tensorflow/core/framework/cancellation.h" #include "tensorflow/core/framework/graph.pb.h" -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/public/session.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/platform/port.h" +#include "tensorflow/core/platform/thread_annotations.h" +#include "tensorflow/core/public/session.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { @@ -70,7 +70,7 @@ class DirectSession : public Session { // Device structures. const std::unique_ptr device_mgr_; - std::vector devices_; // not owned + std::vector devices_; // not owned DeviceSet device_set_; string session_handle_; diff --git a/tensorflow/core/common_runtime/direct_session_test.cc b/tensorflow/core/common_runtime/direct_session_test.cc index d021a3a5c1d..74d1b049c4c 100644 --- a/tensorflow/core/common_runtime/direct_session_test.cc +++ b/tensorflow/core/common_runtime/direct_session_test.cc @@ -5,6 +5,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/tensor_testutil.h" @@ -18,7 +19,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/device_name_utils.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/common_runtime/eigen_thread_pool.h b/tensorflow/core/common_runtime/eigen_thread_pool.h index 2554f3521b8..bdee685fc8a 100644 --- a/tensorflow/core/common_runtime/eigen_thread_pool.h +++ b/tensorflow/core/common_runtime/eigen_thread_pool.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_COMMON_RUNTIME_EIGEN_THREAD_POOL_H_ #define TENSORFLOW_COMMON_RUNTIME_EIGEN_THREAD_POOL_H_ -#include "tensorflow/core/lib/core/threadpool.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/lib/core/threadpool.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/executor.cc b/tensorflow/core/common_runtime/executor.cc index 2d5a63ac925..1c5be34fb87 100644 --- a/tensorflow/core/common_runtime/executor.cc +++ b/tensorflow/core/common_runtime/executor.cc @@ -1,12 +1,12 @@ #include "tensorflow/core/common_runtime/executor.h" #include +#include #include #include #include #include #include -#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/cancellation.h" diff --git a/tensorflow/core/common_runtime/executor.h b/tensorflow/core/common_runtime/executor.h index 82bcbab8362..fdce5ce8430 100644 --- a/tensorflow/core/common_runtime/executor.h +++ b/tensorflow/core/common_runtime/executor.h @@ -4,8 +4,8 @@ #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/framework/rendezvous.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/notification.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" diff --git a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry.cc b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry.cc index 742459c63b9..c56e4f8d128 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/common_runtime/gpu/gpu_allocator_retry.h" -#include "tensorflow/core/public/env.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" +#include "tensorflow/core/public/env.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc index db1c58cc655..1e4a8b9c988 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc @@ -1,11 +1,11 @@ #include "tensorflow/core/common_runtime/gpu/gpu_allocator_retry.h" +#include #include "tensorflow/core/lib/core/notification.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/public/env.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc index 5ec405cd80f..2766de4f03a 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h" -#include "tensorflow/core/common_runtime/gpu/gpu_init.h" #include "tensorflow/stream_executor/multi_platform_manager.h" #include "tensorflow/stream_executor/stream_executor.h" +#include "tensorflow/core/common_runtime/gpu/gpu_init.h" namespace gpu = ::perftools::gputools; diff --git a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h index c9b564ffc41..03bb9dc4d55 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h +++ b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h @@ -6,9 +6,9 @@ #include #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/common_runtime/gpu/visitable_allocator.h" #include "tensorflow/stream_executor/stream_executor.h" +#include "tensorflow/core/common_runtime/gpu/visitable_allocator.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator_test.cc b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator_test.cc index 5f639065765..f8fe894f9e3 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_debug_allocator_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_debug_allocator_test.cc @@ -5,14 +5,14 @@ #include #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/lib/gtl/inlined_vector.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/common_runtime/gpu/gpu_init.h" -#include "tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.h" #include "tensorflow/stream_executor/multi_platform_manager.h" #include "tensorflow/stream_executor/stream_executor.h" #include +#include "tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.h" +#include "tensorflow/core/common_runtime/gpu/gpu_init.h" +#include "tensorflow/core/lib/gtl/inlined_vector.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace gpu = ::perftools::gputools; diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index b6bae7c0f8c..c1255220486 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -92,7 +92,7 @@ class EigenAllocator : public ::Eigen::Allocator { } private: - gpu::Stream* stream_; // Not owned. + gpu::Stream* stream_; // Not owned. ::tensorflow::Allocator* allocator_; // Not owned. ::tensorflow::EventMgr* em_; // Not owned. @@ -144,8 +144,8 @@ class EigenCudaStreamDevice : public ::Eigen::StreamInterface { delete data; } - const cudaStream_t* stream_; // Not owned. - const cudaDeviceProp* device_prop_; // Not owned. + const cudaStream_t* stream_; // Not owned. + const cudaDeviceProp* device_prop_; // Not owned. ::tensorflow::Allocator* allocator_; // Not owned. TF_DISALLOW_COPY_AND_ASSIGN(EigenCudaStreamDevice); diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.h b/tensorflow/core/common_runtime/gpu/gpu_device.h index a415224d95b..d07a28a11c8 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.h +++ b/tensorflow/core/common_runtime/gpu/gpu_device.h @@ -5,7 +5,10 @@ #ifndef TENSORFLOW_COMMON_RUNTIME_GPU_GPU_DEVICE_H_ #define TENSORFLOW_COMMON_RUNTIME_GPU_GPU_DEVICE_H_ +#include "tensorflow/stream_executor/stream.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/common_runtime/device_factory.h" +#include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" #include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/core/common_runtime/local_device.h" #include "tensorflow/core/framework/allocator.h" @@ -15,9 +18,6 @@ #include "tensorflow/core/public/session_options.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" -#include "tensorflow/stream_executor/stream.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc b/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc index 30ca1ff1873..74929f53f9c 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc @@ -2,10 +2,10 @@ #include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" -#include "tensorflow/core/common_runtime/gpu/gpu_init.h" #include "tensorflow/stream_executor/multi_platform_manager.h" #include "tensorflow/stream_executor/stream_executor.h" #include +#include "tensorflow/core/common_runtime/gpu/gpu_init.h" namespace gpu = ::perftools::gputools; diff --git a/tensorflow/core/common_runtime/gpu/gpu_init.cc b/tensorflow/core/common_runtime/gpu/gpu_init.cc index 631a47eb91c..81200e1c146 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_init.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_init.cc @@ -2,13 +2,13 @@ #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/stream_executor/multi_platform_manager.h" #include "tensorflow/stream_executor/stream_executor.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/strings/numbers.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace gpu = ::perftools::gputools; diff --git a/tensorflow/core/common_runtime/gpu/gpu_region_allocator_test.cc b/tensorflow/core/common_runtime/gpu/gpu_region_allocator_test.cc index 07b0dd57f67..3f3d708baf1 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_region_allocator_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_region_allocator_test.cc @@ -5,12 +5,12 @@ #include #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/lib/gtl/inlined_vector.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/common_runtime/gpu/gpu_init.h" #include "tensorflow/stream_executor/stream_executor.h" #include +#include "tensorflow/core/common_runtime/gpu/gpu_init.h" +#include "tensorflow/core/lib/gtl/inlined_vector.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace gpu = ::perftools::gputools; diff --git a/tensorflow/core/common_runtime/gpu/gpu_util.cc b/tensorflow/core/common_runtime/gpu/gpu_util.cc index a6a3ce01fc8..c37aeeeffab 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_util.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_util.cc @@ -1,7 +1,12 @@ #include "tensorflow/core/common_runtime/gpu/gpu_util.h" //#include "base/commandlineflags.h" +#include "tensorflow/stream_executor/stream.h" +#include "tensorflow/stream_executor/stream_executor.h" #include "tensorflow/core/common_runtime/device.h" +#include "tensorflow/core/common_runtime/gpu/dma_helper.h" +#include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" +#include "tensorflow/core/common_runtime/gpu/process_state.h" #include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/core/errors.h" @@ -15,12 +20,7 @@ #include "tensorflow/core/platform/tensor_coding.h" #include "tensorflow/core/platform/tracing.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/common_runtime/gpu/dma_helper.h" -#include "tensorflow/core/common_runtime/gpu/gpu_event_mgr.h" -#include "tensorflow/core/common_runtime/gpu/process_state.h" #include "tensorflow/core/util/util.h" -#include "tensorflow/stream_executor/stream.h" -#include "tensorflow/stream_executor/stream_executor.h" #include "tensorflow/core/platform/stream_executor_util.h" diff --git a/tensorflow/core/common_runtime/gpu/gpu_util.h b/tensorflow/core/common_runtime/gpu/gpu_util.h index 1d8c3a054d7..0073bd327d0 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_util.h +++ b/tensorflow/core/common_runtime/gpu/gpu_util.h @@ -1,11 +1,11 @@ #ifndef TENSORFLOW_COMMON_RUNTIME_GPU_GPU_UTIL_H_ #define TENSORFLOW_COMMON_RUNTIME_GPU_GPU_UTIL_H_ -#include "tensorflow/core/common_runtime/device.h" -#include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/public/status.h" -#include "tensorflow/core/common_runtime/gpu/dma_helper.h" #include "tensorflow/stream_executor/device_memory.h" +#include "tensorflow/core/common_runtime/device.h" +#include "tensorflow/core/common_runtime/gpu/dma_helper.h" +#include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" #include "tensorflow/stream_executor/stream.h" diff --git a/tensorflow/core/common_runtime/gpu/gpu_util_platform_specific.cc b/tensorflow/core/common_runtime/gpu/gpu_util_platform_specific.cc index f1b1174a28e..7b4cb72b99b 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_util_platform_specific.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_util_platform_specific.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/common_runtime/device.h" +#include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu/gpu_util.h" #include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/common_runtime/gpu/gpu_util.h" -#include "tensorflow/stream_executor/stream.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/pool_allocator.cc b/tensorflow/core/common_runtime/gpu/pool_allocator.cc index 52deb7fce2f..a7277f835f4 100644 --- a/tensorflow/core/common_runtime/gpu/pool_allocator.cc +++ b/tensorflow/core/common_runtime/gpu/pool_allocator.cc @@ -6,10 +6,10 @@ #include +//#include "prodkernel/api/base/numa.h" #include "tensorflow/core/lib/strings/numbers.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -//#include "prodkernel/api/base/numa.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/pool_allocator.h b/tensorflow/core/common_runtime/gpu/pool_allocator.h index d10aabe88aa..9b535b76d47 100644 --- a/tensorflow/core/common_runtime/gpu/pool_allocator.h +++ b/tensorflow/core/common_runtime/gpu/pool_allocator.h @@ -8,11 +8,11 @@ #include #include #include +#include "tensorflow/stream_executor/stream_executor.h" +#include "tensorflow/core/common_runtime/gpu/visitable_allocator.h" #include "tensorflow/core/lib/core/bits.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/common_runtime/gpu/visitable_allocator.h" -#include "tensorflow/stream_executor/stream_executor.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/gpu/process_state.cc b/tensorflow/core/common_runtime/gpu/process_state.cc index fa9c0170f54..77446ab7539 100644 --- a/tensorflow/core/common_runtime/gpu/process_state.cc +++ b/tensorflow/core/common_runtime/gpu/process_state.cc @@ -1,15 +1,15 @@ #include "tensorflow/core/common_runtime/gpu/process_state.h" -#include "tensorflow/core/framework/allocator.h" -#include "tensorflow/core/common_runtime/gpu/gpu_init.h" +#include "tensorflow/stream_executor/multi_platform_manager.h" #include "tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.h" #include "tensorflow/core/common_runtime/gpu/gpu_debug_allocator.h" +#include "tensorflow/core/common_runtime/gpu/gpu_init.h" #include "tensorflow/core/common_runtime/gpu/gpu_region_allocator.h" #include "tensorflow/core/common_runtime/gpu/pool_allocator.h" +#include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/stream_executor/multi_platform_manager.h" #if defined(PLATFORM_GOOGLE) DEFINE_bool(record_mem_types, false, diff --git a/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc b/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc index 28afc95c1bc..2ae47bf284f 100644 --- a/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc +++ b/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc @@ -4,17 +4,17 @@ #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/graph/graph.h" #include "tensorflow/core/framework/op_segment.h" -#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/graph/graph.h" +#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/notification.h" #include "tensorflow/core/lib/core/threadpool.h" #include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/util/device_name_utils.h" -#include "tensorflow/core/lib/core/notification.h" -#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/session_options.h" +#include "tensorflow/core/util/device_name_utils.h" #if defined(PLATFORM_GOOGLE) DECLARE_bool(brain_gpu_use_bfc_allocator); @@ -71,9 +71,7 @@ Benchmark::Benchmark(const string& device, Graph* g, TF_CHECK_OK(NewLocalExecutor( { - device_, - nullptr, - false, + device_, nullptr, false, [this](const NodeDef& ndef, OpKernel** kernel) { return CreateNonCachedKernel(device_, nullptr, ndef, kernel); }, diff --git a/tensorflow/core/common_runtime/kernel_benchmark_testlib.h b/tensorflow/core/common_runtime/kernel_benchmark_testlib.h index 5ebe13e1d46..eb0b6db135d 100644 --- a/tensorflow/core/common_runtime/kernel_benchmark_testlib.h +++ b/tensorflow/core/common_runtime/kernel_benchmark_testlib.h @@ -4,10 +4,10 @@ #include #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/lib/core/threadpool.h" #include "tensorflow/core/common_runtime/executor.h" #include "tensorflow/core/graph/testlib.h" +#include "tensorflow/core/lib/core/threadpool.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/local_device.cc b/tensorflow/core/common_runtime/local_device.cc index 6a753468053..9e2827f45c2 100644 --- a/tensorflow/core/common_runtime/local_device.cc +++ b/tensorflow/core/common_runtime/local_device.cc @@ -1,12 +1,12 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/common_runtime/eigen_thread_pool.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/common_runtime/local_device.h" #include "tensorflow/core/lib/core/threadpool.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/session_options.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/session_test.cc b/tensorflow/core/common_runtime/session_test.cc index 82b5d7ffb0c..96a0f586795 100644 --- a/tensorflow/core/common_runtime/session_test.cc +++ b/tensorflow/core/common_runtime/session_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/public/session.h" -#include "tensorflow/core/public/session_options.h" #include +#include "tensorflow/core/public/session_options.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/common_runtime/simple_placer.h b/tensorflow/core/common_runtime/simple_placer.h index 4b3df50c72d..f9fda93833b 100644 --- a/tensorflow/core/common_runtime/simple_placer.h +++ b/tensorflow/core/common_runtime/simple_placer.h @@ -7,9 +7,9 @@ #include "tensorflow/core/common_runtime/device_set.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/platform/port.h" +#include "tensorflow/core/public/session_options.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/util/device_name_utils.h" -#include "tensorflow/core/public/session_options.h" namespace tensorflow { diff --git a/tensorflow/core/common_runtime/simple_placer_test.cc b/tensorflow/core/common_runtime/simple_placer_test.cc index 3139962d7e6..c0502e6a349 100644 --- a/tensorflow/core/common_runtime/simple_placer_test.cc +++ b/tensorflow/core/common_runtime/simple_placer_test.cc @@ -5,6 +5,7 @@ #include #include +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_set.h" #include "tensorflow/core/framework/device_attributes.pb.h" @@ -20,7 +21,6 @@ #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/strcat.h" -#include namespace tensorflow { diff --git a/tensorflow/core/example/feature.proto b/tensorflow/core/example/feature.proto index 5ab77c2997f..5a3a9dd4bf0 100644 --- a/tensorflow/core/example/feature.proto +++ b/tensorflow/core/example/feature.proto @@ -75,8 +75,8 @@ message BytesList { repeated bytes value = 1; } message FloatList { - repeated float value = 1 [packed=true]; + repeated float value = 1 [packed = true]; } message Int64List { - repeated int64 value = 1 [packed=true]; + repeated int64 value = 1 [packed = true]; } diff --git a/tensorflow/core/framework/allocator.h b/tensorflow/core/framework/allocator.h index 6f162a608c4..9a46695d366 100644 --- a/tensorflow/core/framework/allocator.h +++ b/tensorflow/core/framework/allocator.h @@ -6,8 +6,8 @@ #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/framework/allocator_test.cc b/tensorflow/core/framework/allocator_test.cc index 6b1e52cfc4d..73e951846ab 100644 --- a/tensorflow/core/framework/allocator_test.cc +++ b/tensorflow/core/framework/allocator_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/framework/allocator.h" #include -#include "tensorflow/core/platform/logging.h" #include +#include "tensorflow/core/platform/logging.h" namespace tensorflow { TEST(CPUAllocatorTest, Simple) { diff --git a/tensorflow/core/framework/attr_value_util.h b/tensorflow/core/framework/attr_value_util.h index 1faf74a327b..7d8e50b478c 100644 --- a/tensorflow/core/framework/attr_value_util.h +++ b/tensorflow/core/framework/attr_value_util.h @@ -4,11 +4,11 @@ #include #include "tensorflow/core/framework/attr_value.pb.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/framework/bfloat16.h b/tensorflow/core/framework/bfloat16.h index 9cd260ee13c..a0bb1b66a30 100644 --- a/tensorflow/core/framework/bfloat16.h +++ b/tensorflow/core/framework/bfloat16.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_FRAMEWORK_BFLOAT16_H_ #define TENSORFLOW_FRAMEWORK_BFLOAT16_H_ -#include "tensorflow/core/platform/port.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/platform/port.h" // Compact 16-bit encoding of floating point numbers. This representation uses // 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa. It diff --git a/tensorflow/core/framework/bfloat16_test.cc b/tensorflow/core/framework/bfloat16_test.cc index 4fe791fdeb5..671659ad2e1 100644 --- a/tensorflow/core/framework/bfloat16_test.cc +++ b/tensorflow/core/framework/bfloat16_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/framework/bfloat16.h" -#include "tensorflow/core/platform/test_benchmark.h" #include +#include "tensorflow/core/platform/test_benchmark.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/cancellation_test.cc b/tensorflow/core/framework/cancellation_test.cc index 1925dd20cc2..4a359ca2d81 100644 --- a/tensorflow/core/framework/cancellation_test.cc +++ b/tensorflow/core/framework/cancellation_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/framework/cancellation.h" +#include #include "tensorflow/core/lib/core/notification.h" #include "tensorflow/core/lib/core/threadpool.h" -#include namespace tensorflow { diff --git a/tensorflow/core/framework/control_flow.h b/tensorflow/core/framework/control_flow.h index f59e0f53108..6ab7a7ed883 100644 --- a/tensorflow/core/framework/control_flow.h +++ b/tensorflow/core/framework/control_flow.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_FRAMEWORK_CONTROL_FLOW_H_ #define TENSORFLOW_FRAMEWORK_CONTROL_FLOW_H_ -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/hash/hash.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/framework/device_base.h b/tensorflow/core/framework/device_base.h index ed4ffc5d94c..6948190f88a 100644 --- a/tensorflow/core/framework/device_base.h +++ b/tensorflow/core/framework/device_base.h @@ -6,11 +6,11 @@ #include "tensorflow/core/framework/device_attributes.pb.h" #include "tensorflow/core/framework/tensor.pb.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/refcount.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace Eigen { class ThreadPoolDevice; diff --git a/tensorflow/core/framework/fake_input.cc b/tensorflow/core/framework/fake_input.cc index 493c35e05f8..50756c92c8f 100644 --- a/tensorflow/core/framework/fake_input.cc +++ b/tensorflow/core/framework/fake_input.cc @@ -84,8 +84,7 @@ Status FakeInputImpl::AddInputToBuilder() { } else { if (!dt_specified_ && !arg_->type_list_attr().empty()) { DataTypeVector dts; - Status status = - GetNodeAttr(*node_def_, arg_->type_list_attr(), &dts); + Status status = GetNodeAttr(*node_def_, arg_->type_list_attr(), &dts); if (!status.ok()) { return errors::InvalidArgument( "Could not infer list of types for input '", arg_->name(), "': ", diff --git a/tensorflow/core/framework/function_test.cc b/tensorflow/core/framework/function_test.cc index c9483fad181..f6d1b7d6ae1 100644 --- a/tensorflow/core/framework/function_test.cc +++ b/tensorflow/core/framework/function_test.cc @@ -1,4 +1,5 @@ #include "tensorflow/core/framework/function.h" +#include #include "tensorflow/core/framework/function.pb.h" #include "tensorflow/core/framework/function_testlib.h" #include "tensorflow/core/framework/graph.pb.h" @@ -10,7 +11,6 @@ #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/port.h" -#include namespace tensorflow { diff --git a/tensorflow/core/framework/kernel_def_builder_test.cc b/tensorflow/core/framework/kernel_def_builder_test.cc index eba7144b59d..c5a9a88855b 100644 --- a/tensorflow/core/framework/kernel_def_builder_test.cc +++ b/tensorflow/core/framework/kernel_def_builder_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/framework/kernel_def_builder.h" +#include #include "tensorflow/core/framework/kernel_def.pb.h" #include "tensorflow/core/platform/protobuf.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/node_def_builder.cc b/tensorflow/core/framework/node_def_builder.cc index 12757f153a3..59dfc9d2183 100644 --- a/tensorflow/core/framework/node_def_builder.cc +++ b/tensorflow/core/framework/node_def_builder.cc @@ -49,8 +49,7 @@ bool NodeDefBuilder::NextArgAvailable() { NodeDefBuilder& NodeDefBuilder::Input(FakeInputFunctor fake_input) { if (NextArgAvailable()) { - Status status = - fake_input(*op_def_, inputs_specified_, node_def_, this); + Status status = fake_input(*op_def_, inputs_specified_, node_def_, this); if (!status.ok()) errors_.push_back(status.error_message()); } return *this; diff --git a/tensorflow/core/framework/node_def_builder.h b/tensorflow/core/framework/node_def_builder.h index 706f072608e..8130a030cad 100644 --- a/tensorflow/core/framework/node_def_builder.h +++ b/tensorflow/core/framework/node_def_builder.h @@ -8,15 +8,15 @@ #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_def.pb.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/gtl/array_slice.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { class NodeDefBuilder; typedef std::function FakeInputFunctor; + NodeDefBuilder*)> FakeInputFunctor; // This is a helper for creating a NodeDef. Automatically sets attrs // that can be inferred from the inputs, and uses default values diff --git a/tensorflow/core/framework/node_def_builder_test.cc b/tensorflow/core/framework/node_def_builder_test.cc index 1a2ae586b6f..2dfdad2248b 100644 --- a/tensorflow/core/framework/node_def_builder_test.cc +++ b/tensorflow/core/framework/node_def_builder_test.cc @@ -1,13 +1,13 @@ #include "tensorflow/core/framework/node_def_builder.h" #include +#include #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op_def_builder.h" #include "tensorflow/core/framework/op_def_util.h" -#include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/lib/core/status_test_util.h" -#include +#include "tensorflow/core/platform/protobuf.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/node_def_util_test.cc b/tensorflow/core/framework/node_def_util_test.cc index 765fdfcb8d8..06770c80096 100644 --- a/tensorflow/core/framework/node_def_util_test.cc +++ b/tensorflow/core/framework/node_def_util_test.cc @@ -1,13 +1,13 @@ #include "tensorflow/core/framework/node_def_util.h" +#include #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/op_def_builder.h" #include "tensorflow/core/framework/op_def_util.h" -#include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" -#include +#include "tensorflow/core/platform/protobuf.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/numeric_op.h b/tensorflow/core/framework/numeric_op.h index 8413d18f336..bc7ec35e113 100644 --- a/tensorflow/core/framework/numeric_op.h +++ b/tensorflow/core/framework/numeric_op.h @@ -2,11 +2,11 @@ #define TENSORFLOW_FRAMEWORK_NUMERIC_OP_H_ #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/framework/op_def_builder_test.cc b/tensorflow/core/framework/op_def_builder_test.cc index e53bad7075d..c57438777c1 100644 --- a/tensorflow/core/framework/op_def_builder_test.cc +++ b/tensorflow/core/framework/op_def_builder_test.cc @@ -1,12 +1,12 @@ #include "tensorflow/core/framework/op_def_builder.h" -#include "tensorflow/core/framework/op_def.pb.h" -#include "tensorflow/core/platform/protobuf.h" -#include "tensorflow/core/lib/strings/strcat.h" -#include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/lib/core/status_test_util.h" #include +#include "tensorflow/core/framework/op_def.pb.h" +#include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/lib/core/stringpiece.h" +#include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/protobuf.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/op_def_util.cc b/tensorflow/core/framework/op_def_util.cc index 7b0fa668bff..952d1e5c223 100644 --- a/tensorflow/core/framework/op_def_util.cc +++ b/tensorflow/core/framework/op_def_util.cc @@ -62,7 +62,7 @@ Status AllowedStringValue(const string& str, const OpDef::AttrDef& attr) { // Requires: attr has already been validated. Status ValidateAttrValue(const AttrValue& attr_value, - const OpDef::AttrDef& attr) { + const OpDef::AttrDef& attr) { // Is it a valid value? TF_RETURN_WITH_CONTEXT_IF_ERROR(AttrValueHasType(attr_value, attr.type()), " for attr '", attr.name(), "'"); @@ -149,7 +149,7 @@ OpDef::AttrDef* FindAttrMutable(StringPiece name, OpDef* op_def) { } while (false) static Status ValidateArg(const OpDef::ArgDef& arg, const OpDef& op_def, - bool output, std::set* names) { + bool output, std::set* names) { const string suffix = strings::StrCat( output ? " for output '" : " for input '", arg.name(), "'"); VALIDATE(gtl::InsertIfNotPresent(names, arg.name()), "Duplicate name: ", diff --git a/tensorflow/core/framework/op_def_util.h b/tensorflow/core/framework/op_def_util.h index c8440c5defb..b2096ed5338 100644 --- a/tensorflow/core/framework/op_def_util.h +++ b/tensorflow/core/framework/op_def_util.h @@ -16,7 +16,7 @@ Status ValidateOpDef(const OpDef& op_def); // Validates that attr_value satisfies the type and constraints from attr. // REQUIRES: attr has already been validated. Status ValidateAttrValue(const AttrValue& attr_value, - const OpDef::AttrDef& attr); + const OpDef::AttrDef& attr); // The following search through op_def for an attr with the indicated name. // Returns nullptr if no such attr is found. diff --git a/tensorflow/core/framework/op_def_util_test.cc b/tensorflow/core/framework/op_def_util_test.cc index dabf87e18a1..40d375e5321 100644 --- a/tensorflow/core/framework/op_def_util_test.cc +++ b/tensorflow/core/framework/op_def_util_test.cc @@ -1,12 +1,12 @@ #include "tensorflow/core/framework/op_def_util.h" +#include #include "tensorflow/core/framework/op_def.pb.h" #include "tensorflow/core/framework/op_def_builder.h" -#include "tensorflow/core/platform/protobuf.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/strings/str_util.h" -#include +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/protobuf.h" namespace tensorflow { namespace { @@ -19,9 +19,7 @@ OpDef FromText(const string& text) { class ValidateOpDefTest : public ::testing::Test { protected: - Status TestProto(const string& text) { - return ValidateOpDef(FromText(text)); - } + Status TestProto(const string& text) { return ValidateOpDef(FromText(text)); } Status TestBuilder(const OpDefBuilder& builder) { OpDef op_def; diff --git a/tensorflow/core/framework/op_kernel.h b/tensorflow/core/framework/op_kernel.h index 34d588c6c9a..1f39c499005 100644 --- a/tensorflow/core/framework/op_kernel.h +++ b/tensorflow/core/framework/op_kernel.h @@ -841,7 +841,7 @@ class OpKernelContext { void NotifyUseOfPersistentTensor(const Tensor& tensor); Status status_; - Params params_; // immutable after construction. + Params params_; // immutable after construction. const PerOpGpuDevice* eigen_gpu_device_; // owned, with a per-op // wrapped allocator mutable mutex mu_; // mutable so const accessors can acquire the lock diff --git a/tensorflow/core/framework/op_kernel_test.cc b/tensorflow/core/framework/op_kernel_test.cc index 9400ef24f86..e2701b6c86d 100644 --- a/tensorflow/core/framework/op_kernel_test.cc +++ b/tensorflow/core/framework/op_kernel_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/attr_value_util.h" #include "tensorflow/core/framework/fake_input.h" @@ -14,7 +15,6 @@ #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/protobuf.h" -#include class DummyKernel : public tensorflow::OpKernel { public: diff --git a/tensorflow/core/framework/op_segment_test.cc b/tensorflow/core/framework/op_segment_test.cc index 6297718df85..f9f8cd2724d 100644 --- a/tensorflow/core/framework/op_segment_test.cc +++ b/tensorflow/core/framework/op_segment_test.cc @@ -1,15 +1,15 @@ #include "tensorflow/core/framework/op_segment.h" +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/ops_util.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/strings/strcat.h" -#include #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { diff --git a/tensorflow/core/framework/rendezvous.cc b/tensorflow/core/framework/rendezvous.cc index 205098d58f5..ae97c39ff26 100644 --- a/tensorflow/core/framework/rendezvous.cc +++ b/tensorflow/core/framework/rendezvous.cc @@ -3,12 +3,12 @@ #include #include -#include "tensorflow/core/platform/thread_annotations.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/notification.h" #include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" +#include "tensorflow/core/platform/thread_annotations.h" namespace tensorflow { diff --git a/tensorflow/core/framework/rendezvous.h b/tensorflow/core/framework/rendezvous.h index 94fbfb2523a..803c5c2b907 100644 --- a/tensorflow/core/framework/rendezvous.h +++ b/tensorflow/core/framework/rendezvous.h @@ -3,11 +3,11 @@ #include -#include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/lib/core/refcount.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/framework/control_flow.h" #include "tensorflow/core/framework/device_base.h" +#include "tensorflow/core/lib/core/refcount.h" +#include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/device_name_utils.h" namespace tensorflow { diff --git a/tensorflow/core/framework/tensor_slice.cc b/tensorflow/core/framework/tensor_slice.cc index 473d9463ee0..bcbff4b1674 100644 --- a/tensorflow/core/framework/tensor_slice.cc +++ b/tensorflow/core/framework/tensor_slice.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/framework/tensor_slice.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { @@ -191,7 +191,7 @@ int64 TensorSlice::GetExtentLength(const TensorSliceProto::Extent& extent) { } Status TensorSlice::SliceTensorShape(const TensorShape& shape, - TensorShape* result_shape) const { + TensorShape* result_shape) const { result_shape->Clear(); // Mismatching ranks: we can't apply the slice at all. if (shape.dims() != dims()) { diff --git a/tensorflow/core/framework/tensor_slice.h b/tensorflow/core/framework/tensor_slice.h index 62e15437897..ac5624418a8 100644 --- a/tensorflow/core/framework/tensor_slice.h +++ b/tensorflow/core/framework/tensor_slice.h @@ -2,13 +2,13 @@ #define TENSORFLOW_FRAMEWORK_TENSOR_SLICE_H_ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/tensor_slice.pb.h" +#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/inlined_vector.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/core/stringpiece.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { @@ -121,7 +121,7 @@ class TensorSlice { // For example, given a tensor shape of {3, 4, 5}, and a slice of // 1,2:-:0,2, the result shape is {2, 4, 2}. Status SliceTensorShape(const TensorShape& shape, - TensorShape* result_shape) const; + TensorShape* result_shape) const; // Given slice "sub" where "sub" is fully contained in *this, // (meaning that the intersection of "sub" and *this equals "sub"), computes diff --git a/tensorflow/core/framework/tensor_slice_test.cc b/tensorflow/core/framework/tensor_slice_test.cc index 5f718a56b68..5ce2d410303 100644 --- a/tensorflow/core/framework/tensor_slice_test.cc +++ b/tensorflow/core/framework/tensor_slice_test.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/framework/tensor_slice.h" -#include "tensorflow/core/platform/protobuf.h" -#include "tensorflow/core/platform/logging.h" #include #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/protobuf.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/tensor_test.cc b/tensorflow/core/framework/tensor_test.cc index 4963c2c2196..549bf934798 100644 --- a/tensorflow/core/framework/tensor_test.cc +++ b/tensorflow/core/framework/tensor_test.cc @@ -1,11 +1,11 @@ #include "tensorflow/core/public/tensor.h" +#include #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/framework/tensor_testutil.h b/tensorflow/core/framework/tensor_testutil.h index 53d6da0fb29..c14a11a2f47 100644 --- a/tensorflow/core/framework/tensor_testutil.h +++ b/tensorflow/core/framework/tensor_testutil.h @@ -1,10 +1,10 @@ #ifndef TENSORFLOW_FRAMEWORK_TENSOR_TESTUTIL_H_ #define TENSORFLOW_FRAMEWORK_TENSOR_TESTUTIL_H_ +#include #include "tensorflow/core/lib/gtl/array_slice.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { namespace test { diff --git a/tensorflow/core/framework/tensor_util_test.cc b/tensorflow/core/framework/tensor_util_test.cc index fef7468151b..44914000e62 100644 --- a/tensorflow/core/framework/tensor_util_test.cc +++ b/tensorflow/core/framework/tensor_util_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/framework/tensor_util.h" +#include #include "tensorflow/core/framework/types.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/framework/tracking_allocator_test.cc b/tensorflow/core/framework/tracking_allocator_test.cc index 90ce851775b..c63a0efda6f 100644 --- a/tensorflow/core/framework/tracking_allocator_test.cc +++ b/tensorflow/core/framework/tracking_allocator_test.cc @@ -2,9 +2,9 @@ #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/platform/logging.h" -#include namespace tensorflow { diff --git a/tensorflow/core/framework/types.h b/tensorflow/core/framework/types.h index 2d417cf076c..a205676532a 100644 --- a/tensorflow/core/framework/types.h +++ b/tensorflow/core/framework/types.h @@ -5,6 +5,7 @@ #include #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint" #include "tensorflow/core/framework/bfloat16.h" #include "tensorflow/core/framework/numeric_types.h" #include "tensorflow/core/framework/types.pb.h" @@ -13,7 +14,6 @@ #include "tensorflow/core/lib/gtl/inlined_vector.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint" namespace tensorflow { diff --git a/tensorflow/core/graph/algorithm_test.cc b/tensorflow/core/graph/algorithm_test.cc index 48f2e1ebd7f..17c5a2af835 100644 --- a/tensorflow/core/graph/algorithm_test.cc +++ b/tensorflow/core/graph/algorithm_test.cc @@ -3,14 +3,14 @@ #include #include +#include #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_def_builder.h" #include "tensorflow/core/graph/subgraph.h" #include "tensorflow/core/kernels/ops_util.h" -#include -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/public/status.h" // TODO(josh11b): Test setting the "device" field of a NodeDef. // TODO(josh11b): Test that feeding won't prune targets. diff --git a/tensorflow/core/graph/colors.cc b/tensorflow/core/graph/colors.cc index 0eb2fc37403..6ef7168b7ef 100644 --- a/tensorflow/core/graph/colors.cc +++ b/tensorflow/core/graph/colors.cc @@ -7,15 +7,15 @@ namespace tensorflow { // Color palette // http://www.mulinblog.com/a-color-palette-optimized-for-data-visualization/ static const char* kColors[] = { - "#F15854", // red - "#5DA5DA", // blue - "#FAA43A", // orange - "#60BD68", // green - "#F17CB0", // pink - "#B2912F", // brown - "#B276B2", // purple - "#DECF3F", // yellow - "#4D4D4D", // gray + "#F15854", // red + "#5DA5DA", // blue + "#FAA43A", // orange + "#60BD68", // green + "#F17CB0", // pink + "#B2912F", // brown + "#B276B2", // purple + "#DECF3F", // yellow + "#4D4D4D", // gray }; const char* ColorFor(int dindex) { diff --git a/tensorflow/core/graph/costutil.cc b/tensorflow/core/graph/costutil.cc index f8e2d9fe681..f958e564cbb 100644 --- a/tensorflow/core/graph/costutil.cc +++ b/tensorflow/core/graph/costutil.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/graph/costutil.h" #include "tensorflow/core/graph/algorithm.h" -#include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/costmodel.h" +#include "tensorflow/core/graph/graph.h" namespace tensorflow { diff --git a/tensorflow/core/graph/dot.cc b/tensorflow/core/graph/dot.cc index 6d6e46ce610..4936354c112 100644 --- a/tensorflow/core/graph/dot.cc +++ b/tensorflow/core/graph/dot.cc @@ -6,8 +6,8 @@ #include "tensorflow/core/graph/colors.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/regexp.h" #include "tensorflow/core/util/util.h" diff --git a/tensorflow/core/graph/edgeset_test.cc b/tensorflow/core/graph/edgeset_test.cc index 7909e8ea0aa..980c07719f4 100644 --- a/tensorflow/core/graph/edgeset_test.cc +++ b/tensorflow/core/graph/edgeset_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/graph/edgeset.h" -#include "tensorflow/core/graph/graph.h" #include +#include "tensorflow/core/graph/graph.h" namespace tensorflow { class EdgeSetTest : public ::testing::Test { diff --git a/tensorflow/core/graph/equal_graph_def_test.cc b/tensorflow/core/graph/equal_graph_def_test.cc index 3a38b9e5226..4b9f307c1ae 100644 --- a/tensorflow/core/graph/equal_graph_def_test.cc +++ b/tensorflow/core/graph/equal_graph_def_test.cc @@ -1,10 +1,10 @@ #include "tensorflow/core/graph/equal_graph_def.h" -#include "tensorflow/core/framework/op.h" +#include #include "tensorflow/core/framework/node_def_util.h" +#include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/graph_def_builder.h" #include "tensorflow/core/kernels/ops_util.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/graph/graph_constructor.cc b/tensorflow/core/graph/graph_constructor.cc index 3928348f0a9..d8742a7f14a 100644 --- a/tensorflow/core/graph/graph_constructor.cc +++ b/tensorflow/core/graph/graph_constructor.cc @@ -349,7 +349,7 @@ bool GraphConstructor::TypeValidateEdge(const Edge* edge) { // ---------------------------------------------------------------------------- Status ConvertGraphDefToGraph(const GraphConstructorOptions& opts, - const GraphDef& gdef, Graph* g) { + const GraphDef& gdef, Graph* g) { Status status; GraphConstructor constructor(opts, &gdef, g, &status); return status; diff --git a/tensorflow/core/graph/graph_constructor.h b/tensorflow/core/graph/graph_constructor.h index cd1615ef6b3..c498c8f16b0 100644 --- a/tensorflow/core/graph/graph_constructor.h +++ b/tensorflow/core/graph/graph_constructor.h @@ -30,7 +30,7 @@ struct GraphConstructorOptions { std::function cse_consider_function = nullptr; }; extern Status ConvertGraphDefToGraph(const GraphConstructorOptions& opts, - const GraphDef& gdef, Graph* g); + const GraphDef& gdef, Graph* g); // Make a copy of "src" into "*dest". // diff --git a/tensorflow/core/graph/graph_constructor_test.cc b/tensorflow/core/graph/graph_constructor_test.cc index 61f4427297d..382227d4a06 100644 --- a/tensorflow/core/graph/graph_constructor_test.cc +++ b/tensorflow/core/graph/graph_constructor_test.cc @@ -1,5 +1,6 @@ #include "tensorflow/core/graph/graph_constructor.h" +#include #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/kernels/ops_util.h" @@ -8,7 +9,6 @@ #include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/platform/regexp.h" #include "tensorflow/core/public/status.h" -#include // TODO(josh11b): Test InitCostModel(). // TODO(josh11b): Test setting the "device" field of a NodeDef. diff --git a/tensorflow/core/graph/graph_def_builder.h b/tensorflow/core/graph/graph_def_builder.h index bb72f9eea63..236be381fa9 100644 --- a/tensorflow/core/graph/graph_def_builder.h +++ b/tensorflow/core/graph/graph_def_builder.h @@ -6,9 +6,9 @@ #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/node_builder.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/graph/graph_partition.h b/tensorflow/core/graph/graph_partition.h index eb88ff71b1b..eaff09177e6 100644 --- a/tensorflow/core/graph/graph_partition.h +++ b/tensorflow/core/graph/graph_partition.h @@ -6,8 +6,8 @@ #include #include "tensorflow/core/framework/graph.pb.h" -#include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/costmodel.h" +#include "tensorflow/core/graph/graph.h" namespace tensorflow { diff --git a/tensorflow/core/graph/node_builder.h b/tensorflow/core/graph/node_builder.h index dd34b97f234..38470988449 100644 --- a/tensorflow/core/graph/node_builder.h +++ b/tensorflow/core/graph/node_builder.h @@ -6,8 +6,8 @@ #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_def.pb.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/graph/node_builder_test.cc b/tensorflow/core/graph/node_builder_test.cc index 9f667d00e4b..595c3c4d734 100644 --- a/tensorflow/core/graph/node_builder_test.cc +++ b/tensorflow/core/graph/node_builder_test.cc @@ -1,10 +1,10 @@ #include "tensorflow/core/graph/node_builder.h" +#include #include "tensorflow/core/framework/op.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/graph/subgraph.cc b/tensorflow/core/graph/subgraph.cc index 7910511dfb7..81100f39144 100644 --- a/tensorflow/core/graph/subgraph.cc +++ b/tensorflow/core/graph/subgraph.cc @@ -15,8 +15,8 @@ #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/node_builder.h" #include "tensorflow/core/graph/tensor_id.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" namespace tensorflow { @@ -41,8 +41,8 @@ typedef std::unordered_map NameIndex; // an appropriate error message (and *g is left in an indeterminate // state). static Status FeedInputs(Graph* g, const DeviceAttributes& device_info, - const gtl::ArraySlice& fed_outputs, - NameIndex* name_index) { + const gtl::ArraySlice& fed_outputs, + NameIndex* name_index) { for (const string& t : fed_outputs) { TensorId id(ParseTensorName(t)); diff --git a/tensorflow/core/graph/subgraph_test.cc b/tensorflow/core/graph/subgraph_test.cc index ffb3e6e4038..dbb07251e0f 100644 --- a/tensorflow/core/graph/subgraph_test.cc +++ b/tensorflow/core/graph/subgraph_test.cc @@ -3,6 +3,7 @@ #include #include +#include #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_constructor.h" @@ -15,7 +16,6 @@ #include "tensorflow/core/platform/regexp.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/status.h" -#include // TODO(josh11b): Test setting the "device" field of a NodeDef. // TODO(josh11b): Test that feeding won't prune targets. @@ -100,8 +100,8 @@ class SubgraphTest : public ::testing::Test { std::vector targets = str_util::Split(targets_str, ',', str_util::SkipEmpty()); - Status s = subgraph::RewriteGraphForExecution(subgraph, fed, fetch, - targets, device_info_); + Status s = subgraph::RewriteGraphForExecution(subgraph, fed, fetch, targets, + device_info_); if (!s.ok()) { delete subgraph; return s.ToString(); diff --git a/tensorflow/core/graph/tensor_id.h b/tensorflow/core/graph/tensor_id.h index f1f38468759..bc3e6dadf0b 100644 --- a/tensorflow/core/graph/tensor_id.h +++ b/tensorflow/core/graph/tensor_id.h @@ -3,8 +3,8 @@ #include -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/lib/core/stringpiece.h" +#include "tensorflow/core/lib/strings/strcat.h" namespace tensorflow { diff --git a/tensorflow/core/graph/testlib.h b/tensorflow/core/graph/testlib.h index 2a5ad6e14aa..164d1bcc36e 100644 --- a/tensorflow/core/graph/testlib.h +++ b/tensorflow/core/graph/testlib.h @@ -6,9 +6,9 @@ #include #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/types.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" diff --git a/tensorflow/core/graph/types.h b/tensorflow/core/graph/types.h index 41400611a95..bb0d3a17ca7 100644 --- a/tensorflow/core/graph/types.h +++ b/tensorflow/core/graph/types.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_GRAPH_TYPES_H_ #define TENSORFLOW_GRAPH_TYPES_H_ -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/gtl/int_type.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/adjust_contrast_op.cc b/tensorflow/core/kernels/adjust_contrast_op.cc index 7cc05343541..858e558c3d9 100644 --- a/tensorflow/core/kernels/adjust_contrast_op.cc +++ b/tensorflow/core/kernels/adjust_contrast_op.cc @@ -2,6 +2,7 @@ #define EIGEN_USE_THREADS #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -10,7 +11,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { @@ -20,8 +20,8 @@ typedef Eigen::GpuDevice GPUDevice; template class AdjustContrastOp : public OpKernel { public: - explicit AdjustContrastOp(OpKernelConstruction* context) : OpKernel(context) { - } + explicit AdjustContrastOp(OpKernelConstruction* context) + : OpKernel(context) {} void Compute(OpKernelContext* context) override { const Tensor& input = context->input(0); diff --git a/tensorflow/core/kernels/adjust_contrast_op.h b/tensorflow/core/kernels/adjust_contrast_op.h index 2182b33c039..eea647d2636 100644 --- a/tensorflow/core/kernels/adjust_contrast_op.h +++ b/tensorflow/core/kernels/adjust_contrast_op.h @@ -1,7 +1,7 @@ #ifndef TENSORFLOW_KERNELS_ADJUST_CONTRAST_OP_H_ #define TENSORFLOW_KERNELS_ADJUST_CONTRAST_OP_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/aggregate_ops.h b/tensorflow/core/kernels/aggregate_ops.h index 22149019708..560df5cdf41 100644 --- a/tensorflow/core/kernels/aggregate_ops.h +++ b/tensorflow/core/kernels/aggregate_ops.h @@ -3,8 +3,8 @@ // Functor definitions for Aggregate ops, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/aggregate_ops_gpu.cu.cc b/tensorflow/core/kernels/aggregate_ops_gpu.cu.cc index 5cf2934ac1f..a466d002a3b 100644 --- a/tensorflow/core/kernels/aggregate_ops_gpu.cu.cc +++ b/tensorflow/core/kernels/aggregate_ops_gpu.cu.cc @@ -4,8 +4,8 @@ #include "tensorflow/core/kernels/aggregate_ops.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/argmax_op.cc b/tensorflow/core/kernels/argmax_op.cc index 0845eebf098..ce302712361 100644 --- a/tensorflow/core/kernels/argmax_op.cc +++ b/tensorflow/core/kernels/argmax_op.cc @@ -9,14 +9,14 @@ #include "tensorflow/core/kernels/argmax_op.h" #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/argmax_op.h b/tensorflow/core/kernels/argmax_op.h index 41734f3254a..e8c06a191c9 100644 --- a/tensorflow/core/kernels/argmax_op.h +++ b/tensorflow/core/kernels/argmax_op.h @@ -2,9 +2,9 @@ #define TENSORFLOW_KERNELS_ARGMAX_OP_H_ // Generator definition for ArgMaxOp, must be compilable by nvcc. -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/assign_op.h b/tensorflow/core/kernels/assign_op.h index 3306f1eeaad..b0c0f3671b3 100644 --- a/tensorflow/core/kernels/assign_op.h +++ b/tensorflow/core/kernels/assign_op.h @@ -3,9 +3,9 @@ #define EIGEN_USE_THREADS +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_types.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/attention_ops.cc b/tensorflow/core/kernels/attention_ops.cc index 28763f65a4a..49d69cfcf84 100644 --- a/tensorflow/core/kernels/attention_ops.cc +++ b/tensorflow/core/kernels/attention_ops.cc @@ -3,13 +3,13 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/platform/port.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" namespace tensorflow { diff --git a/tensorflow/core/kernels/avgpooling_op.cc b/tensorflow/core/kernels/avgpooling_op.cc index 26f98ffbcd4..b9f623ca485 100644 --- a/tensorflow/core/kernels/avgpooling_op.cc +++ b/tensorflow/core/kernels/avgpooling_op.cc @@ -4,19 +4,19 @@ #include "tensorflow/core/kernels/avgpooling_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/pooling_ops_common.h" -#include "tensorflow/core/lib/gtl/array_slice.h" -#include "tensorflow/core/util/padding.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" -#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/util/padding.h" #if GOOGLE_CUDA #include "tensorflow/core/kernels/maxpooling_op_gpu.h" @@ -34,14 +34,12 @@ class AvgPoolingOp : public UnaryOp { explicit AvgPoolingOp(OpKernelConstruction* context) : UnaryOp(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window stride field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window stride field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( @@ -56,9 +54,8 @@ class AvgPoolingOp : public UnaryOp { return; } OP_REQUIRES(context, params.depth_window == 1, - errors::Unimplemented( - "Non-spatial pooling is not " - "yet supported. Volunteers? :)")); + errors::Unimplemented("Non-spatial pooling is not " + "yet supported. Volunteers? :)")); // For avgpooling, tensor_in should have 4 dimensions. OP_REQUIRES(context, tensor_in.dims() == 4, @@ -123,14 +120,12 @@ class AvgPoolingGradOp : public OpKernel { explicit AvgPoolingGradOp(OpKernelConstruction* context) : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( @@ -141,11 +136,11 @@ class AvgPoolingGradOp : public OpKernel { const Tensor& tensor_in_shape = context->input(0); const Tensor& out_backprop = context->input(1); // For avgpooling, tensor_in_shape should have 1 dimension, and 4 elements. - OP_REQUIRES(context, tensor_in_shape.dims() == 1 && - tensor_in_shape.NumElements() == 4, - errors::InvalidArgument( - "out_backprop must be 1-dimensional and 4 " - "elements")); + OP_REQUIRES( + context, + tensor_in_shape.dims() == 1 && tensor_in_shape.NumElements() == 4, + errors::InvalidArgument("out_backprop must be 1-dimensional and 4 " + "elements")); // For avgpooling, out_backprop should have 4 dimensions. OP_REQUIRES(context, out_backprop.dims() == 4, errors::InvalidArgument("out_backprop must be 4-dimensional")); @@ -178,9 +173,8 @@ class AvgPoolingGradOp : public OpKernel { // // Spatial pooling is when depth_window = 1 OP_REQUIRES(context, depth_window == 1, - errors::Unimplemented( - "Non-spatial pooling is not " - "yet supported. Volunteers? :)")); + errors::Unimplemented("Non-spatial pooling is not " + "yet supported. Volunteers? :)")); int out_height, out_width, pad_rows, pad_cols; OP_REQUIRES_OK( diff --git a/tensorflow/core/kernels/avgpooling_op.h b/tensorflow/core/kernels/avgpooling_op.h index 38f0eb97e55..1617539c384 100644 --- a/tensorflow/core/kernels/avgpooling_op.h +++ b/tensorflow/core/kernels/avgpooling_op.h @@ -2,9 +2,9 @@ #define TENSORFLOW_KERNELS_AVGPOOLING_OP_H_ // Functor definition for AvgPoolingOp, must be compilable by nvcc. -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/batch_matmul_op.cc b/tensorflow/core/kernels/batch_matmul_op.cc index 349aac01580..737f52eabf4 100644 --- a/tensorflow/core/kernels/batch_matmul_op.cc +++ b/tensorflow/core/kernels/batch_matmul_op.cc @@ -14,8 +14,8 @@ #include "tensorflow/core/util/work_sharder.h" #if GOOGLE_CUDA -#include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu_device_context.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/batch_norm_op.cc b/tensorflow/core/kernels/batch_norm_op.cc index c67c9216314..65af47487bd 100644 --- a/tensorflow/core/kernels/batch_norm_op.cc +++ b/tensorflow/core/kernels/batch_norm_op.cc @@ -3,11 +3,11 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/batch_norm_op.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/batch_norm_op.h b/tensorflow/core/kernels/batch_norm_op.h index 5981e584609..f1c6e47d14b 100644 --- a/tensorflow/core/kernels/batch_norm_op.h +++ b/tensorflow/core/kernels/batch_norm_op.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_BATCH_NORM_OP_H_ #define TENSORFLOW_KERNELS_BATCH_NORM_OP_H_ // Functor definition for BatchNormOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/bias_op.cc b/tensorflow/core/kernels/bias_op.cc index 68737f6c2dc..59dd617609c 100644 --- a/tensorflow/core/kernels/bias_op.cc +++ b/tensorflow/core/kernels/bias_op.cc @@ -3,11 +3,11 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/bias_op.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/bias_op.h b/tensorflow/core/kernels/bias_op.h index 513406d251d..764954ffb41 100644 --- a/tensorflow/core/kernels/bias_op.h +++ b/tensorflow/core/kernels/bias_op.h @@ -2,8 +2,8 @@ #define TENSORFLOW_KERNELS_BIAS_OP_H_ // Functor definition for BiasOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/cast_op.h b/tensorflow/core/kernels/cast_op.h index d066206abc8..817d14ee11a 100644 --- a/tensorflow/core/kernels/cast_op.h +++ b/tensorflow/core/kernels/cast_op.h @@ -1,10 +1,10 @@ #ifndef TENSORFLOW_KERNELS_CAST_OP_H_ #define TENSORFLOW_KERNELS_CAST_OP_H_ +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/bfloat16.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/platform/port.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/cast_op_test.cc b/tensorflow/core/kernels/cast_op_test.cc index f774fbcfe87..3878d7a9145 100644 --- a/tensorflow/core/kernels/cast_op_test.cc +++ b/tensorflow/core/kernels/cast_op_test.cc @@ -1,12 +1,12 @@ #include "tensorflow/core/framework/fake_input.h" +#include +#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/check_numerics_op.cc b/tensorflow/core/kernels/check_numerics_op.cc index 65487a303ce..f234ba00fc1 100644 --- a/tensorflow/core/kernels/check_numerics_op.cc +++ b/tensorflow/core/kernels/check_numerics_op.cc @@ -8,8 +8,8 @@ #include "tensorflow/core/public/tensor.h" #if GOOGLE_CUDA -#include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu_device_context.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/check_numerics_op_gpu.cu.cc b/tensorflow/core/kernels/check_numerics_op_gpu.cu.cc index cb84f987312..dc7cf6ba0b8 100644 --- a/tensorflow/core/kernels/check_numerics_op_gpu.cu.cc +++ b/tensorflow/core/kernels/check_numerics_op_gpu.cu.cc @@ -1,14 +1,14 @@ #if GOOGLE_CUDA #define EIGEN_USE_GPU -#include #include +#include #include #include -#include "tensorflow/core/platform/port.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/cholesky_op.cc b/tensorflow/core/kernels/cholesky_op.cc index 12632fb248e..f5d53cca451 100644 --- a/tensorflow/core/kernels/cholesky_op.cc +++ b/tensorflow/core/kernels/cholesky_op.cc @@ -4,6 +4,7 @@ #include +#include "third_party/eigen3/Eigen/Cholesky" #include "tensorflow/core/framework/kernel_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/linalg_ops_common.h" @@ -11,7 +12,6 @@ #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/Eigen/Cholesky" namespace tensorflow { diff --git a/tensorflow/core/kernels/concat_op.cc b/tensorflow/core/kernels/concat_op.cc index adc802cb452..9219daddf84 100644 --- a/tensorflow/core/kernels/concat_op.cc +++ b/tensorflow/core/kernels/concat_op.cc @@ -2,15 +2,15 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/framework/types.h" #include "tensorflow/core/kernels/concat_op.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/concat_op_test.cc b/tensorflow/core/kernels/concat_op_test.cc index 4ccc5b5b19e..2f232f8fdd8 100644 --- a/tensorflow/core/kernels/concat_op_test.cc +++ b/tensorflow/core/kernels/concat_op_test.cc @@ -2,19 +2,19 @@ #include #include +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/graph/node_builder.h" +#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_testutil.h" #include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include -#include "tensorflow/core/lib/core/status_test_util.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/constant_op.cc b/tensorflow/core/kernels/constant_op.cc index 281bafd3df9..5956d5f9b85 100644 --- a/tensorflow/core/kernels/constant_op.cc +++ b/tensorflow/core/kernels/constant_op.cc @@ -4,13 +4,13 @@ #include "tensorflow/core/kernels/constant_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor.pb.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/kernels/fill_functor.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/constant_op.h b/tensorflow/core/kernels/constant_op.h index 20a5c9c42ff..f7bdb2b7d8b 100644 --- a/tensorflow/core/kernels/constant_op.h +++ b/tensorflow/core/kernels/constant_op.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_KERNELS_CONSTANT_OP_H_ #define TENSORFLOW_KERNELS_CONSTANT_OP_H_ +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_types.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/control_flow_ops_test.cc b/tensorflow/core/kernels/control_flow_ops_test.cc index 52bc11abf01..8f350542bba 100644 --- a/tensorflow/core/kernels/control_flow_ops_test.cc +++ b/tensorflow/core/kernels/control_flow_ops_test.cc @@ -1,11 +1,11 @@ #include "tensorflow/core/framework/fake_input.h" +#include #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/tensor_testutil.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/conv_2d.h b/tensorflow/core/kernels/conv_2d.h index 2fb623244c1..e4ea02b7bc7 100644 --- a/tensorflow/core/kernels/conv_2d.h +++ b/tensorflow/core/kernels/conv_2d.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_KERNELS_CONV_2D_H_ #define TENSORFLOW_KERNELS_CONV_2D_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/conv_grad_ops.cc b/tensorflow/core/kernels/conv_grad_ops.cc index eeb9fa4c388..16f4d55477c 100644 --- a/tensorflow/core/kernels/conv_grad_ops.cc +++ b/tensorflow/core/kernels/conv_grad_ops.cc @@ -5,20 +5,20 @@ #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/gtl/array_slice.h" -#include "tensorflow/core/util/use_cudnn.h" -#include "tensorflow/core/util/padding.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/util/padding.h" +#include "tensorflow/core/util/use_cudnn.h" #if GOOGLE_CUDA -#include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu_device_context.h" #endif // GOOGLE_CUDA namespace tensorflow { @@ -271,17 +271,16 @@ class Conv2DFastBackpropInputOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("strides", &strides_)); OP_REQUIRES(context, strides_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES(context, strides_[1] == strides_[2], errors::InvalidArgument( "Current implementation only supports equal length " "strides in the row and column dimensions.")); - OP_REQUIRES(context, (strides_[0] == 1 && strides_[3] == 1), - errors::InvalidArgument( - "Current implementation does not yet support " - "strides in the batch and depth dimensions.")); + OP_REQUIRES( + context, (strides_[0] == 1 && strides_[3] == 1), + errors::InvalidArgument("Current implementation does not yet support " + "strides in the batch and depth dimensions.")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); } @@ -444,17 +443,16 @@ class Conv2DFastBackpropFilterOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("strides", &strides_)); OP_REQUIRES(context, strides_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES(context, strides_[1] == strides_[2], errors::InvalidArgument( "Current implementation only supports equal length " "strides in the row and column dimensions.")); - OP_REQUIRES(context, (strides_[0] == 1 && strides_[3] == 1), - errors::InvalidArgument( - "Current implementation does not yet support " - "strides in the batch and depth dimensions.")); + OP_REQUIRES( + context, (strides_[0] == 1 && strides_[3] == 1), + errors::InvalidArgument("Current implementation does not yet support " + "strides in the batch and depth dimensions.")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); } @@ -668,17 +666,16 @@ class Conv2DSlowBackpropInputOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("strides", &strides_)); OP_REQUIRES(context, strides_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES(context, strides_[1] == strides_[2], errors::InvalidArgument( "Current implementation only supports equal length " "strides in the row and column dimensions.")); - OP_REQUIRES(context, (strides_[0] == 1 && strides_[3] == 1), - errors::InvalidArgument( - "Current implementation does not yet support " - "strides in the batch and depth dimensions.")); + OP_REQUIRES( + context, (strides_[0] == 1 && strides_[3] == 1), + errors::InvalidArgument("Current implementation does not yet support " + "strides in the batch and depth dimensions.")); OP_REQUIRES_OK(context, context->GetAttr("use_cudnn_on_gpu", &use_cudnn_)); use_cudnn_ &= CanUseCudnn(); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); @@ -901,17 +898,16 @@ class Conv2DSlowBackpropFilterOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("strides", &strides_)); OP_REQUIRES(context, strides_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES(context, strides_[1] == strides_[2], errors::InvalidArgument( "Current implementation only supports equal length " "strides in the row and column dimensions.")); - OP_REQUIRES(context, (strides_[0] == 1 && strides_[3] == 1), - errors::InvalidArgument( - "Current implementation does not yet support " - "strides in the batch and depth dimensions.")); + OP_REQUIRES( + context, (strides_[0] == 1 && strides_[3] == 1), + errors::InvalidArgument("Current implementation does not yet support " + "strides in the batch and depth dimensions.")); OP_REQUIRES_OK(context, context->GetAttr("use_cudnn_on_gpu", &use_cudnn_)); use_cudnn_ &= CanUseCudnn(); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); diff --git a/tensorflow/core/kernels/conv_ops.cc b/tensorflow/core/kernels/conv_ops.cc index aaa29517787..0ca5afd9437 100644 --- a/tensorflow/core/kernels/conv_ops.cc +++ b/tensorflow/core/kernels/conv_ops.cc @@ -5,20 +5,20 @@ #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/gtl/array_slice.h" -#include "tensorflow/core/util/use_cudnn.h" -#include "tensorflow/core/util/padding.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/util/padding.h" +#include "tensorflow/core/util/use_cudnn.h" #if GOOGLE_CUDA -#include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu_device_context.h" #endif // GOOGLE_CUDA namespace tensorflow { @@ -81,17 +81,16 @@ class Conv2DOp : public BinaryOp { OP_REQUIRES_OK(context, context->GetAttr("use_cudnn_on_gpu", &use_cudnn_)); use_cudnn_ &= CanUseCudnn(); OP_REQUIRES(context, strides_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES(context, strides_[1] == strides_[2], errors::InvalidArgument( "Current implementation only supports equal length " "strides in the row and column dimensions.")); - OP_REQUIRES(context, (strides_[0] == 1 && strides_[3] == 1), - errors::InvalidArgument( - "Current implementation does not yet support " - "strides in the batch and depth dimensions.")); + OP_REQUIRES( + context, (strides_[0] == 1 && strides_[3] == 1), + errors::InvalidArgument("Current implementation does not yet support " + "strides in the batch and depth dimensions.")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); } diff --git a/tensorflow/core/kernels/core_ops_test.cc b/tensorflow/core/kernels/core_ops_test.cc index a42a5999dae..08e6660ebb5 100644 --- a/tensorflow/core/kernels/core_ops_test.cc +++ b/tensorflow/core/kernels/core_ops_test.cc @@ -9,6 +9,7 @@ #include #include +#include #include "tensorflow/cc/ops/const_op.h" #include "tensorflow/cc/ops/nn_ops.h" #include "tensorflow/core/common_runtime/device_factory.h" @@ -27,13 +28,12 @@ #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/core/threadpool.h" -#include "tensorflow/core/util/padding.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/session.h" #include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/util/padding.h" #include "tensorflow/core/util/port.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/cwise_ops.h b/tensorflow/core/kernels/cwise_ops.h index 7d818cfbbfe..37bc51d6611 100644 --- a/tensorflow/core/kernels/cwise_ops.h +++ b/tensorflow/core/kernels/cwise_ops.h @@ -3,9 +3,9 @@ #include #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_types.h" #include "tensorflow/core/framework/tensor_types.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" // The following functors (sign, tanh, sigmoid, etc.) are not defined // by Eigen. When their equivalent are added into the Eigen, we can @@ -28,8 +28,8 @@ struct scalar_sign_op { // EIGEN host/device decoration. We duplicate code here for now. template struct pow { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T - operator()(const T& x, const T& y) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T operator()(const T& x, + const T& y) const { return std::pow(x, y); } }; @@ -72,8 +72,8 @@ struct scalar_fmod2_op { template struct scalar_mod2_op { EIGEN_EMPTY_STRUCT_CTOR(scalar_mod2_op) - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T - operator()(const T& a, const T& b) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T operator()(const T& a, + const T& b) const { return a % b; } }; @@ -179,43 +179,55 @@ struct functor_traits > { // similar to std::equal_to, but with the DEVICE_FUNC qualifier template struct equal_to : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x == y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x == y; + } }; // similar to std::not_equal_to, but with the DEVICE_FUNC qualifier template struct not_equal_to : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x != y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x != y; + } }; // similar to std::greater, but with the DEVICE_FUNC qualifier template struct greater : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x > y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x > y; + } }; // similar to std::less, but with the DEVICE_FUNC qualifier template struct less : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x < y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x < y; + } }; // similar to std::greater_equal, but with the DEVICE_FUNC qualifier template struct greater_equal : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x >= y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x >= y; + } }; // similar to std::less_equal, but with the DEVICE_FUNC qualifier template struct less_equal : std::binary_function { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - bool operator()(const T& x, const T& y) const { return x <= y; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool operator()(const T& x, + const T& y) const { + return x <= y; + } }; } // end namespace internal @@ -523,8 +535,8 @@ struct logical_or : base {}; template struct make_complex_func { typedef std::complex result_type; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - result_type operator()(T real, T imag) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE result_type operator()(T real, + T imag) const { return std::complex(real, imag); } }; diff --git a/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h b/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h index b0dc0271441..e4216dcefc7 100644 --- a/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h +++ b/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h @@ -9,9 +9,9 @@ #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/kernels/cwise_ops.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/kernels/cwise_ops.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/logging.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/cwise_ops_test.cc b/tensorflow/core/kernels/cwise_ops_test.cc index 56af2481170..f7835a8f453 100644 --- a/tensorflow/core/kernels/cwise_ops_test.cc +++ b/tensorflow/core/kernels/cwise_ops_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/public/tensor.h" +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/decode_csv_op.cc b/tensorflow/core/kernels/decode_csv_op.cc index 0919bab96fa..7494a853622 100644 --- a/tensorflow/core/kernels/decode_csv_op.cc +++ b/tensorflow/core/kernels/decode_csv_op.cc @@ -198,10 +198,9 @@ class DecodeCSVOp : public OpKernel { } OP_REQUIRES( - ctx, - input[current_idx] == '"' && - (static_cast(current_idx) == input.size() - 1 || - input[current_idx + 1] == delim_), + ctx, input[current_idx] == '"' && + (static_cast(current_idx) == input.size() - 1 || + input[current_idx + 1] == delim_), errors::InvalidArgument("Quoted field has to end with quote " "followed by delim or end")); diff --git a/tensorflow/core/kernels/decode_jpeg_op.cc b/tensorflow/core/kernels/decode_jpeg_op.cc index e41d3f3e110..b5a7d50e7a3 100644 --- a/tensorflow/core/kernels/decode_jpeg_op.cc +++ b/tensorflow/core/kernels/decode_jpeg_op.cc @@ -4,11 +4,11 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/lib/jpeg/jpeg_mem.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/jpeg/jpeg_mem.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/decode_png_op.cc b/tensorflow/core/kernels/decode_png_op.cc index e8071526f93..0adadfd77ff 100644 --- a/tensorflow/core/kernels/decode_png_op.cc +++ b/tensorflow/core/kernels/decode_png_op.cc @@ -4,11 +4,11 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/lib/png/png_io.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/png/png_io.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/dense_update_ops.cc b/tensorflow/core/kernels/dense_update_ops.cc index f56c37b4ef6..4f57a955f0c 100644 --- a/tensorflow/core/kernels/dense_update_ops.cc +++ b/tensorflow/core/kernels/dense_update_ops.cc @@ -4,8 +4,8 @@ #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/assign_op.h" #include "tensorflow/core/kernels/dense_update_ops.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/dense_update_ops.h b/tensorflow/core/kernels/dense_update_ops.h index d32c9a4af29..8aa434dcbd7 100644 --- a/tensorflow/core/kernels/dense_update_ops.h +++ b/tensorflow/core/kernels/dense_update_ops.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_DENSE_UPDATE_OPS_H_ #define TENSORFLOW_KERNELS_DENSE_UPDATE_OPS_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/determinant_op.cc b/tensorflow/core/kernels/determinant_op.cc index d34aab7a445..7bd4c1ceb5c 100644 --- a/tensorflow/core/kernels/determinant_op.cc +++ b/tensorflow/core/kernels/determinant_op.cc @@ -1,6 +1,7 @@ // See docs in ../ops/linalg_ops.cc. #include +#include "third_party/eigen3/Eigen/LU" #include "tensorflow/core/framework/kernel_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/linalg_ops_common.h" @@ -8,7 +9,6 @@ #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/Eigen/LU" namespace tensorflow { diff --git a/tensorflow/core/kernels/diag_op.cc b/tensorflow/core/kernels/diag_op.cc index 83e39d33a9f..fc5d8f44148 100644 --- a/tensorflow/core/kernels/diag_op.cc +++ b/tensorflow/core/kernels/diag_op.cc @@ -1,9 +1,9 @@ // See docs in ../ops/array_ops.cc #include "tensorflow/core/framework/op_kernel.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/dynamic_partition_op_test.cc b/tensorflow/core/kernels/dynamic_partition_op_test.cc index b0e5e7deb01..547702f27d7 100644 --- a/tensorflow/core/kernels/dynamic_partition_op_test.cc +++ b/tensorflow/core/kernels/dynamic_partition_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" @@ -9,11 +10,10 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" -#include +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/dynamic_stitch_op_test.cc b/tensorflow/core/kernels/dynamic_stitch_op_test.cc index 8c71f0fd0fe..c9c6aa8db90 100644 --- a/tensorflow/core/kernels/dynamic_stitch_op_test.cc +++ b/tensorflow/core/kernels/dynamic_stitch_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" @@ -9,13 +10,12 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" +#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/lib/strings/strcat.h" -#include -#include "tensorflow/core/lib/core/status_test_util.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/edit_distance_op.cc b/tensorflow/core/kernels/edit_distance_op.cc index 938d7f056b7..0d32b86685f 100644 --- a/tensorflow/core/kernels/edit_distance_op.cc +++ b/tensorflow/core/kernels/edit_distance_op.cc @@ -5,10 +5,10 @@ #include #include "tensorflow/core/common_runtime/device.h" -#include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" +#include "tensorflow/core/framework/register_types.h" +#include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/gtl/edit_distance.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/util/sparse/sparse_tensor.h" diff --git a/tensorflow/core/kernels/encode_jpeg_op.cc b/tensorflow/core/kernels/encode_jpeg_op.cc index 8f5fd2f8be8..a4ac2cc5b65 100644 --- a/tensorflow/core/kernels/encode_jpeg_op.cc +++ b/tensorflow/core/kernels/encode_jpeg_op.cc @@ -4,11 +4,11 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/lib/jpeg/jpeg_mem.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/jpeg/jpeg_mem.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/encode_png_op.cc b/tensorflow/core/kernels/encode_png_op.cc index 52490743776..e01ec9afe90 100644 --- a/tensorflow/core/kernels/encode_png_op.cc +++ b/tensorflow/core/kernels/encode_png_op.cc @@ -4,11 +4,11 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/lib/png/png_io.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/png/png_io.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/fill_functor.h b/tensorflow/core/kernels/fill_functor.h index 831f0c899ed..7b834bfaa6a 100644 --- a/tensorflow/core/kernels/fill_functor.h +++ b/tensorflow/core/kernels/fill_functor.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_FILL_FUNCTOR_H_ #define TENSORFLOW_KERNELS_FILL_FUNCTOR_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/identity_op_test.cc b/tensorflow/core/kernels/identity_op_test.cc index 6483367a79b..716cd7b4a44 100644 --- a/tensorflow/core/kernels/identity_op_test.cc +++ b/tensorflow/core/kernels/identity_op_test.cc @@ -1,13 +1,13 @@ #include "tensorflow/core/framework/fake_input.h" +#include #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" -#include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/tensor_testutil.h" -#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/framework/types.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/strings/strcat.h" -#include +#include "tensorflow/core/public/tensor.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/in_topk_op.cc b/tensorflow/core/kernels/in_topk_op.cc index d08f6f53da4..d5866b437f7 100644 --- a/tensorflow/core/kernels/in_topk_op.cc +++ b/tensorflow/core/kernels/in_topk_op.cc @@ -3,9 +3,9 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/public/tensor.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/io.cc b/tensorflow/core/kernels/io.cc index 9d6921aa8e7..2233a4df39a 100644 --- a/tensorflow/core/kernels/io.cc +++ b/tensorflow/core/kernels/io.cc @@ -6,9 +6,9 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/lib/strings/stringprintf.h" -#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/util/tensor_slice_reader.h" diff --git a/tensorflow/core/kernels/l2loss_op.cc b/tensorflow/core/kernels/l2loss_op.cc index 6f83f016769..b9abf918f63 100644 --- a/tensorflow/core/kernels/l2loss_op.cc +++ b/tensorflow/core/kernels/l2loss_op.cc @@ -3,11 +3,11 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/l2loss_op.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/l2loss_op.h b/tensorflow/core/kernels/l2loss_op.h index d307353e241..a6eaeafcfc1 100644 --- a/tensorflow/core/kernels/l2loss_op.h +++ b/tensorflow/core/kernels/l2loss_op.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_L2LOSS_OP_H_ #define TENSORFLOW_KERNELS_L2LOSS_OP_H_ // Functor definition for L2LossOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/linalg_ops_common.h b/tensorflow/core/kernels/linalg_ops_common.h index 471f11e25fb..adc4734523e 100644 --- a/tensorflow/core/kernels/linalg_ops_common.h +++ b/tensorflow/core/kernels/linalg_ops_common.h @@ -3,6 +3,7 @@ #define EIGEN_USE_THREADS +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/kernel_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/tensor_types.h" @@ -12,7 +13,6 @@ #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/util/work_sharder.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/listdiff_op.cc b/tensorflow/core/kernels/listdiff_op.cc index f490f5ddd3b..2534d3ce662 100644 --- a/tensorflow/core/kernels/listdiff_op.cc +++ b/tensorflow/core/kernels/listdiff_op.cc @@ -3,9 +3,9 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { template diff --git a/tensorflow/core/kernels/logging_ops.cc b/tensorflow/core/kernels/logging_ops.cc index ec84145f75b..b0bac68b3f7 100644 --- a/tensorflow/core/kernels/logging_ops.cc +++ b/tensorflow/core/kernels/logging_ops.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/logging_ops_test.cc b/tensorflow/core/kernels/logging_ops_test.cc index a7af6eb3030..a03660aea19 100644 --- a/tensorflow/core/kernels/logging_ops_test.cc +++ b/tensorflow/core/kernels/logging_ops_test.cc @@ -1,12 +1,12 @@ #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" -#include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/tensor_testutil.h" -#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/framework/types.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { namespace { @@ -14,7 +14,7 @@ namespace { class PrintingGraphTest : public OpsTestBase { protected: Status Init(DataType input_type1, DataType input_type2, string msg = "", - int first_n = -1, int summarize = 3) { + int first_n = -1, int summarize = 3) { RequireDefaultOps(); TF_CHECK_OK(NodeDefBuilder("op", "Print") .Input(FakeInput(input_type1)) diff --git a/tensorflow/core/kernels/lrn_op.cc b/tensorflow/core/kernels/lrn_op.cc index bb2657085e0..6baa488d5ca 100644 --- a/tensorflow/core/kernels/lrn_op.cc +++ b/tensorflow/core/kernels/lrn_op.cc @@ -4,10 +4,10 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/op_kernel.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #if !defined(__ANDROID__) #include "tensorflow/core/util/work_sharder.h" diff --git a/tensorflow/core/kernels/matmul_op.cc b/tensorflow/core/kernels/matmul_op.cc index 48bdba78b2c..0e5eb02408a 100644 --- a/tensorflow/core/kernels/matmul_op.cc +++ b/tensorflow/core/kernels/matmul_op.cc @@ -9,8 +9,8 @@ #include "tensorflow/core/kernels/fill_functor.h" #if GOOGLE_CUDA -#include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/stream_executor/stream.h" +#include "tensorflow/core/common_runtime/gpu_device_context.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/matmul_op.h b/tensorflow/core/kernels/matmul_op.h index f75b0ded1b1..65d93630eb7 100644 --- a/tensorflow/core/kernels/matmul_op.h +++ b/tensorflow/core/kernels/matmul_op.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_MATMUL_OP_H_ #define TENSORFLOW_KERNELS_MATMUL_OP_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/matmul_op_test.cc b/tensorflow/core/kernels/matmul_op_test.cc index b2b8f3d905f..f30d847309f 100644 --- a/tensorflow/core/kernels/matmul_op_test.cc +++ b/tensorflow/core/kernels/matmul_op_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/public/tensor.h" +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/matrix_inverse_op.cc b/tensorflow/core/kernels/matrix_inverse_op.cc index ad0948d6ef1..7af4aaa3e6e 100644 --- a/tensorflow/core/kernels/matrix_inverse_op.cc +++ b/tensorflow/core/kernels/matrix_inverse_op.cc @@ -1,6 +1,7 @@ // See docs in ../ops/linalg_ops.cc. #include +#include "third_party/eigen3/Eigen/LU" #include "tensorflow/core/framework/kernel_def_builder.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/linalg_ops_common.h" @@ -8,7 +9,6 @@ #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/Eigen/LU" namespace tensorflow { diff --git a/tensorflow/core/kernels/maxpooling_op.cc b/tensorflow/core/kernels/maxpooling_op.cc index 31046018c53..cab90ad7f1a 100644 --- a/tensorflow/core/kernels/maxpooling_op.cc +++ b/tensorflow/core/kernels/maxpooling_op.cc @@ -4,21 +4,21 @@ #include "tensorflow/core/kernels/maxpooling_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/pooling_ops_common.h" -#include "tensorflow/core/lib/gtl/array_slice.h" -#include "tensorflow/core/util/use_cudnn.h" -#include "tensorflow/core/util/padding.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/util/padding.h" +#include "tensorflow/core/util/use_cudnn.h" #if GOOGLE_CUDA #include "tensorflow/stream_executor/stream.h" @@ -156,14 +156,12 @@ class MaxPoolingGradOp : public OpKernel { explicit MaxPoolingGradOp(OpKernelConstruction* context) : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( @@ -274,14 +272,12 @@ class MaxPoolingGradOp : public OpKernel { explicit MaxPoolingGradOp(OpKernelConstruction* context) : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window strides field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window strides field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( @@ -385,14 +381,12 @@ class MaxPoolingWithArgmaxOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window stride field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window stride field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( @@ -435,14 +429,12 @@ class MaxPoolingGradWithArgmaxOp : public OpKernel { : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("ksize", &ksize_)); OP_REQUIRES(context, ksize_.size() == 4, - errors::InvalidArgument( - "Sliding window ksize field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window ksize field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("strides", &stride_)); OP_REQUIRES(context, stride_.size() == 4, - errors::InvalidArgument( - "Sliding window stride field must " - "specify 4 dimensions")); + errors::InvalidArgument("Sliding window stride field must " + "specify 4 dimensions")); OP_REQUIRES_OK(context, context->GetAttr("padding", &padding_)); OP_REQUIRES(context, ksize_[0] == 1 && stride_[0] == 1, errors::Unimplemented( diff --git a/tensorflow/core/kernels/maxpooling_op.h b/tensorflow/core/kernels/maxpooling_op.h index a074174118b..8bad0d0e23c 100644 --- a/tensorflow/core/kernels/maxpooling_op.h +++ b/tensorflow/core/kernels/maxpooling_op.h @@ -2,9 +2,9 @@ #define TENSORFLOW_KERNELS_MAXPOOLING_OP_H_ // Functor definition for MaxPoolingOp, must be compilable by nvcc. -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/maxpooling_op_gpu.cu.cc b/tensorflow/core/kernels/maxpooling_op_gpu.cu.cc index 13684c82f72..47e89b2804e 100644 --- a/tensorflow/core/kernels/maxpooling_op_gpu.cu.cc +++ b/tensorflow/core/kernels/maxpooling_op_gpu.cu.cc @@ -28,9 +28,9 @@ namespace { // int form, keeping track of the flattened index of the input item that // produces the max output. If a nullptr is passed in for mask, no mask // will be produced. -#define CUDA_1D_KERNEL_LOOP(i, n) \ - for (int i = blockIdx.x * blockDim.x + threadIdx.x; \ - i < (n); i += blockDim.x * gridDim.x) +#define CUDA_1D_KERNEL_LOOP(i, n) \ + for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); \ + i += blockDim.x * gridDim.x) // To call the forward and backward functions, use e.g.: // const int kThreadsPerBlock = 1024 diff --git a/tensorflow/core/kernels/maxpooling_op_gpu.h b/tensorflow/core/kernels/maxpooling_op_gpu.h index bfdac904cce..5a5f10073e4 100644 --- a/tensorflow/core/kernels/maxpooling_op_gpu.h +++ b/tensorflow/core/kernels/maxpooling_op_gpu.h @@ -7,9 +7,9 @@ #define EIGEN_USE_GPU -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/ops_testutil.h b/tensorflow/core/kernels/ops_testutil.h index 7a3405bf04e..ebb20e15ab7 100644 --- a/tensorflow/core/kernels/ops_testutil.h +++ b/tensorflow/core/kernels/ops_testutil.h @@ -4,6 +4,7 @@ #include #include +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/framework/allocator.h" @@ -24,7 +25,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/tensor_slice_reader_cache.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/ops_util.cc b/tensorflow/core/kernels/ops_util.cc index ca2925128e8..97a8dbba4c5 100644 --- a/tensorflow/core/kernels/ops_util.cc +++ b/tensorflow/core/kernels/ops_util.cc @@ -81,9 +81,9 @@ Eigen::PaddingType BrainPadding2EigenPadding(Padding padding) { return Eigen::PADDING_SAME; // Prevent compiler warning about missing return } -Status GetBroadcastSize(const int index, const int in_size, - const int ksize, const int stride, - const int pad_size, int* bindex, int* bsize) { +Status GetBroadcastSize(const int index, const int in_size, const int ksize, + const int stride, const int pad_size, int* bindex, + int* bsize) { // Cannot have strides larger than the patch size. if (stride > ksize) { return errors::InvalidArgument( diff --git a/tensorflow/core/kernels/ops_util.h b/tensorflow/core/kernels/ops_util.h index 283338f8df3..527d3495f6a 100644 --- a/tensorflow/core/kernels/ops_util.h +++ b/tensorflow/core/kernels/ops_util.h @@ -3,10 +3,10 @@ // This file contains utilities for various operations. -#include "tensorflow/core/public/status.h" -#include "tensorflow/core/util/padding.h" -#include "tensorflow/core/public/tensor_shape.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/util/padding.h" namespace tensorflow { @@ -85,9 +85,9 @@ Status Get2dOutputSizeVerbose(const int in_height, const int in_width, // index and size for broadcast for that dimension are different from the // current index and kernel size. // This is mainly used by gradient algorithms for pooling operations. -Status GetBroadcastSize(const int index, const int in_size, - const int ksize, const int stride, - const int pad_size, int* bindex, int* bsize); +Status GetBroadcastSize(const int index, const int in_size, const int ksize, + const int stride, const int pad_size, int* bindex, + int* bsize); // Converts Brain's Padding to Eigen's PaddingType. Eigen::PaddingType BrainPadding2EigenPadding(Padding padding); diff --git a/tensorflow/core/kernels/pack_op.cc b/tensorflow/core/kernels/pack_op.cc index cb125ea2fe2..8382413b816 100644 --- a/tensorflow/core/kernels/pack_op.cc +++ b/tensorflow/core/kernels/pack_op.cc @@ -2,15 +2,15 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/framework/types.h" #include "tensorflow/core/kernels/concat_op.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/pad_op.cc b/tensorflow/core/kernels/pad_op.cc index 6c66e54e3d4..e827e1e8805 100644 --- a/tensorflow/core/kernels/pad_op.cc +++ b/tensorflow/core/kernels/pad_op.cc @@ -8,16 +8,16 @@ #include #include -#include "tensorflow/core/platform/port.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/pad_op.h b/tensorflow/core/kernels/pad_op.h index 204a2a13a4b..d63e524b032 100644 --- a/tensorflow/core/kernels/pad_op.h +++ b/tensorflow/core/kernels/pad_op.h @@ -2,9 +2,9 @@ #define TENSORFLOW_KERNELS_PAD_OP_H_ // Functor definition for PadOp, must be compilable by nvcc. -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/pooling_ops_common.cc b/tensorflow/core/kernels/pooling_ops_common.cc index 35e9bd75fa2..edb1b3c288d 100644 --- a/tensorflow/core/kernels/pooling_ops_common.cc +++ b/tensorflow/core/kernels/pooling_ops_common.cc @@ -4,12 +4,12 @@ #include "tensorflow/core/public/tensor.h" #if GOOGLE_CUDA +#include "tensorflow/stream_executor/dnn.h" +#include "tensorflow/stream_executor/stream.h" #include "tensorflow/core/common_runtime/gpu_device_context.h" #include "tensorflow/core/kernels/conv_2d.h" #include "tensorflow/core/kernels/maxpooling_op_gpu.h" #include "tensorflow/core/kernels/pooling_ops_common_gpu.h" -#include "tensorflow/stream_executor/dnn.h" -#include "tensorflow/stream_executor/stream.h" #endif // GOOGLE_CUDA namespace tensorflow { diff --git a/tensorflow/core/kernels/pooling_ops_common.h b/tensorflow/core/kernels/pooling_ops_common.h index d086b6850ec..d9d61ba1c8a 100644 --- a/tensorflow/core/kernels/pooling_ops_common.h +++ b/tensorflow/core/kernels/pooling_ops_common.h @@ -3,15 +3,15 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/avgpooling_op.h" #include "tensorflow/core/kernels/maxpooling_op.h" #include "tensorflow/core/kernels/ops_util.h" -#include "tensorflow/core/util/padding.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/util/padding.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/pooling_ops_common_gpu.h b/tensorflow/core/kernels/pooling_ops_common_gpu.h index 87a3ef5186a..929aac252ac 100644 --- a/tensorflow/core/kernels/pooling_ops_common_gpu.h +++ b/tensorflow/core/kernels/pooling_ops_common_gpu.h @@ -6,15 +6,15 @@ #define THIRD_PARTY_TENSORFLOW_CORE_KERNELS_POOLING_OPS_COMMON_GPU_H_ #include "tensorflow/stream_executor/dnn.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/kernels/avgpooling_op.h" #include "tensorflow/core/kernels/maxpooling_op.h" #include "tensorflow/core/kernels/ops_util.h" -#include "tensorflow/core/util/padding.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/NeuralNetworks" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/util/padding.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/random_crop_op.cc b/tensorflow/core/kernels/random_crop_op.cc index 4fc12e92cb9..0cbe009b89d 100644 --- a/tensorflow/core/kernels/random_crop_op.cc +++ b/tensorflow/core/kernels/random_crop_op.cc @@ -53,12 +53,14 @@ class RandomCropOp : public OpKernel { // Edge case. The target dimensions are larger then the image, so // zero-pad the image. This guarantees that the image will *always* // be [target_height, target_width] in size. - OP_REQUIRES(context, width >= target_width, errors::FailedPrecondition( - "width must be >= target_width: width = ", width, - ", target_width = ", target_width)); - OP_REQUIRES(context, height >= target_height, errors::FailedPrecondition( - "height must be >= target_height: height = ", height, - ", target_height = ", target_height)); + OP_REQUIRES( + context, width >= target_width, + errors::FailedPrecondition("width must be >= target_width: width = ", + width, ", target_width = ", target_width)); + OP_REQUIRES(context, height >= target_height, + errors::FailedPrecondition( + "height must be >= target_height: height = ", height, + ", target_height = ", target_height)); int32 offset_height = 0; int32 offset_width = 0; @@ -92,10 +94,10 @@ class RandomCropOp : public OpKernel { GuardedPhiloxRandom generator_; }; -#define REGISTER_KERNELS(type) \ - REGISTER_KERNEL_BUILDER( \ - Name("RandomCrop").Device(DEVICE_CPU).TypeConstraint("T"), \ - RandomCropOp) +#define REGISTER_KERNELS(type) \ + REGISTER_KERNEL_BUILDER( \ + Name("RandomCrop").Device(DEVICE_CPU).TypeConstraint("T"), \ + RandomCropOp) TF_CALL_REAL_NUMBER_TYPES(REGISTER_KERNELS); #undef REGISTER_KERNELS diff --git a/tensorflow/core/kernels/random_crop_op_test.cc b/tensorflow/core/kernels/random_crop_op_test.cc index 1f232f4969b..6248f451ab3 100644 --- a/tensorflow/core/kernels/random_crop_op_test.cc +++ b/tensorflow/core/kernels/random_crop_op_test.cc @@ -1,4 +1,5 @@ #include "tensorflow/core/framework/allocator.h" +#include #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" @@ -6,11 +7,10 @@ #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" -#include +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/random_op_gpu.cu.cc b/tensorflow/core/kernels/random_op_gpu.cu.cc index 15cf85f27ec..17b1fbb08ad 100644 --- a/tensorflow/core/kernels/random_op_gpu.cu.cc +++ b/tensorflow/core/kernels/random_op_gpu.cu.cc @@ -4,12 +4,12 @@ #include "tensorflow/core/kernels/random_op.h" -#include #include +#include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/lib/random/philox_random.h" #include "tensorflow/core/lib/random/random_distributions.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/random_op_test.cc b/tensorflow/core/kernels/random_op_test.cc index 751b61cfba8..846460fd1d2 100644 --- a/tensorflow/core/kernels/random_op_test.cc +++ b/tensorflow/core/kernels/random_op_test.cc @@ -1,10 +1,10 @@ #include +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/lib/random/philox_random.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/random_shuffle_queue_op.cc b/tensorflow/core/kernels/random_shuffle_queue_op.cc index 0723e4fc617..5e584612521 100644 --- a/tensorflow/core/kernels/random_shuffle_queue_op.cc +++ b/tensorflow/core/kernels/random_shuffle_queue_op.cc @@ -361,9 +361,8 @@ Status RandomShuffleQueue::MatchesNodeDef(const NodeDef& node_def) { GetNodeAttr(node_def, "min_after_dequeue", &min_after_dequeue)); if (min_after_dequeue != min_after_dequeue_) { return errors::InvalidArgument( - "Shared queue '", name_, "' has min_after_dequeue ", - min_after_dequeue_, " but requested min_after_dequeue was ", - min_after_dequeue, "."); + "Shared queue '", name_, "' has min_after_dequeue ", min_after_dequeue_, + " but requested min_after_dequeue was ", min_after_dequeue, "."); } int64 seed = -1; diff --git a/tensorflow/core/kernels/range_sampler.cc b/tensorflow/core/kernels/range_sampler.cc index a3f4e0b0cb9..5d73b07972b 100644 --- a/tensorflow/core/kernels/range_sampler.cc +++ b/tensorflow/core/kernels/range_sampler.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/kernels/range_sampler.h" -#include #include +#include #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/gtl/map_util.h" diff --git a/tensorflow/core/kernels/reader_base.cc b/tensorflow/core/kernels/reader_base.cc index 06211efb380..837ae0b2d89 100644 --- a/tensorflow/core/kernels/reader_base.cc +++ b/tensorflow/core/kernels/reader_base.cc @@ -5,8 +5,8 @@ #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/notification.h" #include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/lib/strings/strcat.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/reduction_ops.h b/tensorflow/core/kernels/reduction_ops.h index b412617a65d..bf5426f8127 100644 --- a/tensorflow/core/kernels/reduction_ops.h +++ b/tensorflow/core/kernels/reduction_ops.h @@ -4,8 +4,8 @@ // Functor definitions for Reduction ops, must be compilable by nvcc. #include -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/reduction_ops_common.h b/tensorflow/core/kernels/reduction_ops_common.h index 2bde3a1a540..e51d26e9574 100644 --- a/tensorflow/core/kernels/reduction_ops_common.h +++ b/tensorflow/core/kernels/reduction_ops_common.h @@ -10,15 +10,15 @@ #include "tensorflow/core/kernels/reduction_ops.h" +#include "third_party/eigen3/Eigen/Core" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/Eigen/Core" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { @@ -59,7 +59,7 @@ class ReductionHelper { ReductionHelper() : reduce_first_axis_(false) {} Status Simplify(const Tensor& data, const Tensor& axis, - const bool keep_dims) { + const bool keep_dims) { // bitmap[i] indicates whether to reduce data along i-th axis. std::vector bitmap(data.dims(), false); auto axis_vec = axis.flat(); @@ -180,7 +180,7 @@ class ReductionHelper { } private: - bool reduce_first_axis_; // True if need to reduce the 0-th dimension. + bool reduce_first_axis_; // True if need to reduce the 0-th dimension. std::vector data_reshape_; // Reshape the data before reduction. std::vector out_shape_; // The final output shape. std::vector out_reshape_; // Reshape the output for reduction. diff --git a/tensorflow/core/kernels/reduction_ops_test.cc b/tensorflow/core/kernels/reduction_ops_test.cc index d96da3c7f14..9eeee5d00f0 100644 --- a/tensorflow/core/kernels/reduction_ops_test.cc +++ b/tensorflow/core/kernels/reduction_ops_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/public/tensor.h" +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/relu_op.cc b/tensorflow/core/kernels/relu_op.cc index d5dd7a81199..d86511f412f 100644 --- a/tensorflow/core/kernels/relu_op.cc +++ b/tensorflow/core/kernels/relu_op.cc @@ -3,12 +3,12 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/relu_op.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/relu_op.h b/tensorflow/core/kernels/relu_op.h index 8ed071cc4a0..771dbbd30a2 100644 --- a/tensorflow/core/kernels/relu_op.h +++ b/tensorflow/core/kernels/relu_op.h @@ -2,8 +2,8 @@ #define TENSORFLOW_KERNELS_RELU_OP_H_ // Functor definition for ReluOp and ReluGradOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/resize_area_op.cc b/tensorflow/core/kernels/resize_area_op.cc index 2b22d38ad6c..9e8d08dfc59 100644 --- a/tensorflow/core/kernels/resize_area_op.cc +++ b/tensorflow/core/kernels/resize_area_op.cc @@ -3,6 +3,7 @@ #include #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -10,7 +11,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/resize_bicubic_op.cc b/tensorflow/core/kernels/resize_bicubic_op.cc index 472fc19b82b..71fcc708271 100644 --- a/tensorflow/core/kernels/resize_bicubic_op.cc +++ b/tensorflow/core/kernels/resize_bicubic_op.cc @@ -3,6 +3,7 @@ #include #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -10,7 +11,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/resize_bilinear_op.cc b/tensorflow/core/kernels/resize_bilinear_op.cc index 5119b93508b..07ab8928911 100644 --- a/tensorflow/core/kernels/resize_bilinear_op.cc +++ b/tensorflow/core/kernels/resize_bilinear_op.cc @@ -2,6 +2,7 @@ #define EIGEN_USE_THREADS #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -9,7 +10,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/resize_bilinear_op_test.cc b/tensorflow/core/kernels/resize_bilinear_op_test.cc index 0ebe2e5f8cc..0d85af7e8f6 100644 --- a/tensorflow/core/kernels/resize_bilinear_op_test.cc +++ b/tensorflow/core/kernels/resize_bilinear_op_test.cc @@ -1,4 +1,5 @@ #include "tensorflow/core/framework/allocator.h" +#include #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" @@ -6,11 +7,10 @@ #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" -#include +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/resize_nearest_neighbor_op.cc b/tensorflow/core/kernels/resize_nearest_neighbor_op.cc index 13089308ce5..0b8f6735516 100644 --- a/tensorflow/core/kernels/resize_nearest_neighbor_op.cc +++ b/tensorflow/core/kernels/resize_nearest_neighbor_op.cc @@ -2,6 +2,7 @@ #define EIGEN_USE_THREADS #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -9,7 +10,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/resize_nearest_neighbor_op_test.cc b/tensorflow/core/kernels/resize_nearest_neighbor_op_test.cc index 8fca1f34e3e..604595150f7 100644 --- a/tensorflow/core/kernels/resize_nearest_neighbor_op_test.cc +++ b/tensorflow/core/kernels/resize_nearest_neighbor_op_test.cc @@ -2,6 +2,7 @@ // order to compare the reference implementation for image resizing in Python // Image Library. #include "tensorflow/core/framework/allocator.h" +#include #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/node_def_builder.h" @@ -9,11 +10,10 @@ #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/public/tensor.h" -#include +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/restore_op_test.cc b/tensorflow/core/kernels/restore_op_test.cc index 59343a8037c..1c4c17f6d6a 100644 --- a/tensorflow/core/kernels/restore_op_test.cc +++ b/tensorflow/core/kernels/restore_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/framework/allocator.h" @@ -18,7 +19,6 @@ #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/tensor_slice_reader_cache.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/reverse_op.cc b/tensorflow/core/kernels/reverse_op.cc index c63dfc1e703..d759d62161f 100644 --- a/tensorflow/core/kernels/reverse_op.cc +++ b/tensorflow/core/kernels/reverse_op.cc @@ -2,6 +2,7 @@ #define EIGEN_USE_THREADS #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" @@ -10,7 +11,6 @@ #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/tensor_shape.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { @@ -38,13 +38,15 @@ class ReverseOp : public OpKernel { errors::InvalidArgument("'dims' must be 1-dimension, not ", dims.dims())); - OP_REQUIRES(context, input_dims == dims.dim_size(0), - errors::InvalidArgument( - "'dims' must have the same number of values as 'input' has " - "dimensions. 'input' has ", input_dims, "'dims' has ", - dims.dim_size(0), " values")); - OP_REQUIRES(context, input_dims <= 8, errors::Unimplemented( - "reverse is not implemented for tensors of rank > 8.")); + OP_REQUIRES( + context, input_dims == dims.dim_size(0), + errors::InvalidArgument( + "'dims' must have the same number of values as 'input' has " + "dimensions. 'input' has ", + input_dims, "'dims' has ", dims.dim_size(0), " values")); + OP_REQUIRES(context, input_dims <= 8, + errors::Unimplemented( + "reverse is not implemented for tensors of rank > 8.")); Tensor* output = nullptr; OP_REQUIRES_OK(context, diff --git a/tensorflow/core/kernels/reverse_op.h b/tensorflow/core/kernels/reverse_op.h index ca13b98a716..79a1119134d 100644 --- a/tensorflow/core/kernels/reverse_op.h +++ b/tensorflow/core/kernels/reverse_op.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_REVERSE_OP_H_ #define TENSORFLOW_KERNELS_REVERSE_OP_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/reverse_op_test.cc b/tensorflow/core/kernels/reverse_op_test.cc index d41c36e693b..47200f6f51d 100644 --- a/tensorflow/core/kernels/reverse_op_test.cc +++ b/tensorflow/core/kernels/reverse_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/framework/allocator.h" @@ -17,7 +18,6 @@ #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/reverse_sequence_op.cc b/tensorflow/core/kernels/reverse_sequence_op.cc index 6673a700efb..d4615ccdf18 100644 --- a/tensorflow/core/kernels/reverse_sequence_op.cc +++ b/tensorflow/core/kernels/reverse_sequence_op.cc @@ -9,14 +9,14 @@ #include "tensorflow/core/kernels/reverse_sequence_op.h" #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/reverse_sequence_op.h b/tensorflow/core/kernels/reverse_sequence_op.h index d1dd572dcb4..7e64fcb2842 100644 --- a/tensorflow/core/kernels/reverse_sequence_op.h +++ b/tensorflow/core/kernels/reverse_sequence_op.h @@ -2,9 +2,9 @@ #define TENSORFLOW_KERNELS_REVERSE_SEQUENCE_OP_H_ // Generator definition for ReverseSequenceOp, must be compilable by nvcc. -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/save_op_test.cc b/tensorflow/core/kernels/save_op_test.cc index ee1ba492a68..24195f24271 100644 --- a/tensorflow/core/kernels/save_op_test.cc +++ b/tensorflow/core/kernels/save_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" @@ -17,7 +18,6 @@ #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/tensor_slice_reader.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/segment_reduction_ops.cc b/tensorflow/core/kernels/segment_reduction_ops.cc index 2b6a8c5a880..7d477246276 100644 --- a/tensorflow/core/kernels/segment_reduction_ops.cc +++ b/tensorflow/core/kernels/segment_reduction_ops.cc @@ -3,15 +3,15 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/Eigen/Core" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/Eigen/Core" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/segment_reduction_ops_test.cc b/tensorflow/core/kernels/segment_reduction_ops_test.cc index 87647a21a84..e2fcc3416b7 100644 --- a/tensorflow/core/kernels/segment_reduction_ops_test.cc +++ b/tensorflow/core/kernels/segment_reduction_ops_test.cc @@ -2,8 +2,10 @@ #include "tensorflow/core/public/session_options.h" +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" +#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" @@ -12,13 +14,11 @@ #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" +#include "tensorflow/core/graph/node_builder.h" +#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include -#include "tensorflow/core/graph/node_builder.h" -#include "tensorflow/core/graph/testlib.h" -#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/sequence_ops.cc b/tensorflow/core/kernels/sequence_ops.cc index 60ba2e15f98..98731e94d09 100644 --- a/tensorflow/core/kernels/sequence_ops.cc +++ b/tensorflow/core/kernels/sequence_ops.cc @@ -2,9 +2,9 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/slice_op.cc b/tensorflow/core/kernels/slice_op.cc index 7e55149cd1e..fc7a04b78ef 100644 --- a/tensorflow/core/kernels/slice_op.cc +++ b/tensorflow/core/kernels/slice_op.cc @@ -8,13 +8,13 @@ #include "tensorflow/core/kernels/slice_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/ops_util.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/slice_op.h b/tensorflow/core/kernels/slice_op.h index 89bc8be8acc..bbbf527dc5f 100644 --- a/tensorflow/core/kernels/slice_op.h +++ b/tensorflow/core/kernels/slice_op.h @@ -3,8 +3,8 @@ // Functor definition for SliceOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/slice_op_test.cc b/tensorflow/core/kernels/slice_op_test.cc index 27c78c6dc04..d4bb4694bae 100644 --- a/tensorflow/core/kernels/slice_op_test.cc +++ b/tensorflow/core/kernels/slice_op_test.cc @@ -2,20 +2,20 @@ #include #include +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/graph.pb.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/graph/node_builder.h" +#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_testutil.h" #include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include -#include "tensorflow/core/lib/core/status_test_util.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/softmax_op.cc b/tensorflow/core/kernels/softmax_op.cc index abe6331a4fb..2e068b3a607 100644 --- a/tensorflow/core/kernels/softmax_op.cc +++ b/tensorflow/core/kernels/softmax_op.cc @@ -3,10 +3,10 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/public/tensor_shape.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/kernels/softmax_op.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/softmax_op.h b/tensorflow/core/kernels/softmax_op.h index 030db4b36be..2db08c21607 100644 --- a/tensorflow/core/kernels/softmax_op.h +++ b/tensorflow/core/kernels/softmax_op.h @@ -2,8 +2,8 @@ #define TENSORFLOW_KERNELS_SOFTMAX_OP_H_ // Functor definition for SoftmaxOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { @@ -54,7 +54,8 @@ struct SoftmaxEigenImpl { logits.maximum(along_class) .eval() .reshape(batch_by_one) - .broadcast(one_by_class)).exp(); + .broadcast(one_by_class)) + .exp(); // softmax = softmax / sum(softmax along classes); softmax.device(d) = (softmax / softmax.sum(along_class) diff --git a/tensorflow/core/kernels/softmax_op_gpu.cu.cc b/tensorflow/core/kernels/softmax_op_gpu.cu.cc index d5aaf9c3649..00d45c8463d 100644 --- a/tensorflow/core/kernels/softmax_op_gpu.cu.cc +++ b/tensorflow/core/kernels/softmax_op_gpu.cu.cc @@ -4,8 +4,8 @@ #include "tensorflow/core/kernels/softmax_op.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/softplus_op.cc b/tensorflow/core/kernels/softplus_op.cc index b5fb57d3c59..6e52ea55efd 100644 --- a/tensorflow/core/kernels/softplus_op.cc +++ b/tensorflow/core/kernels/softplus_op.cc @@ -3,12 +3,12 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/numeric_op.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/softplus_op.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/lib/core/errors.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/softplus_op.h b/tensorflow/core/kernels/softplus_op.h index 3545a78246f..0e49ee87b5a 100644 --- a/tensorflow/core/kernels/softplus_op.h +++ b/tensorflow/core/kernels/softplus_op.h @@ -3,8 +3,8 @@ // Functor definition for SoftplusOp and SoftplusGradOp, must be compilable by // nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/sparse_to_dense_op.cc b/tensorflow/core/kernels/sparse_to_dense_op.cc index 47e91c134d5..392c0e5a076 100644 --- a/tensorflow/core/kernels/sparse_to_dense_op.cc +++ b/tensorflow/core/kernels/sparse_to_dense_op.cc @@ -5,19 +5,19 @@ #define EIGEN_USE_THREADS -#include #include +#include #include #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/lib/strings/stringprintf.h" -#include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/lib/gtl/inlined_vector.h" +#include "tensorflow/core/lib/strings/stringprintf.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/sparse/sparse_tensor.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/sparse_to_dense_op_test.cc b/tensorflow/core/kernels/sparse_to_dense_op_test.cc index e9800ccd688..b5847f8e2ff 100644 --- a/tensorflow/core/kernels/sparse_to_dense_op_test.cc +++ b/tensorflow/core/kernels/sparse_to_dense_op_test.cc @@ -1,6 +1,7 @@ #include #include +#include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/framework/allocator.h" @@ -11,12 +12,11 @@ #include "tensorflow/core/framework/tensor_testutil.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" +#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/session.h" #include "tensorflow/core/public/tensor.h" -#include namespace tensorflow { diff --git a/tensorflow/core/kernels/split_op.cc b/tensorflow/core/kernels/split_op.cc index e8808c1be24..f007bdb3508 100644 --- a/tensorflow/core/kernels/split_op.cc +++ b/tensorflow/core/kernels/split_op.cc @@ -6,13 +6,13 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/ops_util.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/split_op.h b/tensorflow/core/kernels/split_op.h index fb81d93a39f..47ee2d7d3d9 100644 --- a/tensorflow/core/kernels/split_op.h +++ b/tensorflow/core/kernels/split_op.h @@ -2,8 +2,8 @@ #define TENSORFLOW_KERNELS_SPLIT_OP_H_ // Functor definition for SplitOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/summary_image_op.cc b/tensorflow/core/kernels/summary_image_op.cc index ba765f2e847..cf5b74b4fec 100644 --- a/tensorflow/core/kernels/summary_image_op.cc +++ b/tensorflow/core/kernels/summary_image_op.cc @@ -5,9 +5,9 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/summary.pb.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/png/png_io.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/summary_op_test.cc b/tensorflow/core/kernels/summary_op_test.cc index fd271a68624..4d32b11a63b 100644 --- a/tensorflow/core/kernels/summary_op_test.cc +++ b/tensorflow/core/kernels/summary_op_test.cc @@ -2,6 +2,7 @@ #include #include +#include #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/graph.pb.h" @@ -10,16 +11,15 @@ #include "tensorflow/core/framework/summary.pb.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/ops_testutil.h" -#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/histogram/histogram.h" +#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/public/env.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/lib/strings/strcat.h" -#include -#include "tensorflow/core/lib/core/status_test_util.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/kernels/tile_ops.cc b/tensorflow/core/kernels/tile_ops.cc index decc3207a15..b9c7400512c 100644 --- a/tensorflow/core/kernels/tile_ops.cc +++ b/tensorflow/core/kernels/tile_ops.cc @@ -10,9 +10,9 @@ #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op_kernel.h" +#include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/gtl/array_slice.h" #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/lib/core/errors.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/tile_ops.h b/tensorflow/core/kernels/tile_ops.h index 99455adce2a..74de7ea457e 100644 --- a/tensorflow/core/kernels/tile_ops.h +++ b/tensorflow/core/kernels/tile_ops.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_KERNELS_TILE_OPS_H_ #define TENSORFLOW_KERNELS_TILE_OPS_H_ -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/topk_op.cc b/tensorflow/core/kernels/topk_op.cc index 79b5d4d07e4..d5ed0ae2cf7 100644 --- a/tensorflow/core/kernels/topk_op.cc +++ b/tensorflow/core/kernels/topk_op.cc @@ -3,11 +3,11 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/op_kernel.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/lib/gtl/top_n.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/training_ops.h b/tensorflow/core/kernels/training_ops.h index 71f6d0253d8..eb72bd0dd2f 100644 --- a/tensorflow/core/kernels/training_ops.h +++ b/tensorflow/core/kernels/training_ops.h @@ -1,8 +1,8 @@ #ifndef TENSORFLOW_KERNELS_TRAINING_OPS_H_ #define TENSORFLOW_KERNELS_TRAINING_OPS_H_ -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/unique_op.cc b/tensorflow/core/kernels/unique_op.cc index 61f4a54583d..0985c111b8a 100644 --- a/tensorflow/core/kernels/unique_op.cc +++ b/tensorflow/core/kernels/unique_op.cc @@ -3,9 +3,9 @@ #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" -#include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/public/tensor.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor.h" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/unique_op_test.cc b/tensorflow/core/kernels/unique_op_test.cc index 658f2282cf4..245acebd8fb 100644 --- a/tensorflow/core/kernels/unique_op_test.cc +++ b/tensorflow/core/kernels/unique_op_test.cc @@ -2,17 +2,17 @@ #include #include +#include #include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/graph/node_builder.h" +#include "tensorflow/core/graph/testlib.h" #include "tensorflow/core/kernels/ops_testutil.h" #include "tensorflow/core/kernels/ops_util.h" +#include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/tensor.h" -#include -#include "tensorflow/core/lib/core/status_test_util.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/unpack_op.cc b/tensorflow/core/kernels/unpack_op.cc index 5d1376be839..b2b29c495aa 100644 --- a/tensorflow/core/kernels/unpack_op.cc +++ b/tensorflow/core/kernels/unpack_op.cc @@ -4,14 +4,14 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/kernels/split_op.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/gtl/array_slice.h" +#include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/kernels/where_op.cc b/tensorflow/core/kernels/where_op.cc index 9db0943ea79..05fbe1d631e 100644 --- a/tensorflow/core/kernels/where_op.cc +++ b/tensorflow/core/kernels/where_op.cc @@ -5,15 +5,15 @@ #include "tensorflow/core/kernels/where_op.h" #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/where_op.h b/tensorflow/core/kernels/where_op.h index c7b835d02ff..acb375b8f97 100644 --- a/tensorflow/core/kernels/where_op.h +++ b/tensorflow/core/kernels/where_op.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_KERNELS_WHERE_OP_H_ #define TENSORFLOW_KERNELS_WHERE_OP_H_ -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/xent_op.cc b/tensorflow/core/kernels/xent_op.cc index ff54d157afd..7017671f232 100644 --- a/tensorflow/core/kernels/xent_op.cc +++ b/tensorflow/core/kernels/xent_op.cc @@ -3,10 +3,10 @@ #define EIGEN_USE_THREADS #include "tensorflow/core/framework/op_kernel.h" -#include "tensorflow/core/public/tensor_shape.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/kernels/xent_op.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/xent_op.h b/tensorflow/core/kernels/xent_op.h index 46af8406f1d..88db42c7024 100644 --- a/tensorflow/core/kernels/xent_op.h +++ b/tensorflow/core/kernels/xent_op.h @@ -2,8 +2,8 @@ #define TENSORFLOW_KERNELS_XENT_OP_H_ // Functor definition for XentOp, must be compilable by nvcc. -#include "tensorflow/core/framework/tensor_types.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/tensor_types.h" namespace tensorflow { namespace functor { diff --git a/tensorflow/core/kernels/xent_op_gpu.cu.cc b/tensorflow/core/kernels/xent_op_gpu.cu.cc index eec6a84281c..b1dd6aa9a12 100644 --- a/tensorflow/core/kernels/xent_op_gpu.cu.cc +++ b/tensorflow/core/kernels/xent_op_gpu.cu.cc @@ -4,8 +4,8 @@ #include "tensorflow/core/kernels/xent_op.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/framework/tensor_types.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/kernels/xent_op_test.cc b/tensorflow/core/kernels/xent_op_test.cc index 9aab1b09bfc..4c9d9b9e4e0 100644 --- a/tensorflow/core/kernels/xent_op_test.cc +++ b/tensorflow/core/kernels/xent_op_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/public/tensor.h" -#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" -#include "tensorflow/core/platform/test_benchmark.h" #include +#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h" #include "tensorflow/core/kernels/xent_op.h" +#include "tensorflow/core/platform/test_benchmark.h" namespace tensorflow { diff --git a/tensorflow/core/lib/core/bit_cast_test.cc b/tensorflow/core/lib/core/bit_cast_test.cc index 0ea583e96f1..80d5c8e8979 100644 --- a/tensorflow/core/lib/core/bit_cast_test.cc +++ b/tensorflow/core/lib/core/bit_cast_test.cc @@ -1,8 +1,8 @@ // Unit test for bit_cast template. #include "tensorflow/core/lib/core/casts.h" -#include "tensorflow/core/platform/logging.h" #include +#include "tensorflow/core/platform/logging.h" namespace tensorflow { diff --git a/tensorflow/core/lib/core/bits.h b/tensorflow/core/lib/core/bits.h index 5456a631685..3a4730abc96 100644 --- a/tensorflow/core/lib/core/bits.h +++ b/tensorflow/core/lib/core/bits.h @@ -20,9 +20,7 @@ int Log2Ceiling64(uint64 n); #if defined(__GNUC__) // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. -inline int Log2Floor(uint32 n) { - return n == 0 ? -1 : 31 ^ __builtin_clz(n); -} +inline int Log2Floor(uint32 n) { return n == 0 ? -1 : 31 ^ __builtin_clz(n); } // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. inline int Log2Floor64(uint64 n) { @@ -33,8 +31,7 @@ inline int Log2Floor64(uint64 n) { // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. inline int Log2Floor(uint32 n) { - if (n == 0) - return -1; + if (n == 0) return -1; int log = 0; uint32 value = n; for (int i = 4; i >= 0; --i) { diff --git a/tensorflow/core/lib/core/errors.h b/tensorflow/core/lib/core/errors.h index b0badd8c4dd..702262938fc 100644 --- a/tensorflow/core/lib/core/errors.h +++ b/tensorflow/core/lib/core/errors.h @@ -2,8 +2,8 @@ #define TENSORFLOW_LIB_CORE_ERRORS_H_ #include "tensorflow/core/lib/strings/strcat.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { namespace errors { diff --git a/tensorflow/core/lib/core/status_test.cc b/tensorflow/core/lib/core/status_test.cc index 3ef6b3302a2..6eb445b4f10 100644 --- a/tensorflow/core/lib/core/status_test.cc +++ b/tensorflow/core/lib/core/status_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/public/status.h" +#include #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" -#include namespace tensorflow { diff --git a/tensorflow/core/lib/core/threadpool.cc b/tensorflow/core/lib/core/threadpool.cc index e9b84d31020..6a654e03bf1 100644 --- a/tensorflow/core/lib/core/threadpool.cc +++ b/tensorflow/core/lib/core/threadpool.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/lib/core/threadpool.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/tracing.h" namespace tensorflow { diff --git a/tensorflow/core/lib/core/threadpool_test.cc b/tensorflow/core/lib/core/threadpool_test.cc index f4909c445c3..58a184e4cc8 100644 --- a/tensorflow/core/lib/core/threadpool_test.cc +++ b/tensorflow/core/lib/core/threadpool_test.cc @@ -2,9 +2,9 @@ #include +#include #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/public/env.h" -#include namespace tensorflow { namespace thread { diff --git a/tensorflow/core/lib/gtl/array_slice_test.cc b/tensorflow/core/lib/gtl/array_slice_test.cc index 33ee8fc8dd7..b7b7f96466e 100644 --- a/tensorflow/core/lib/gtl/array_slice_test.cc +++ b/tensorflow/core/lib/gtl/array_slice_test.cc @@ -5,10 +5,10 @@ #include #include +#include #include "tensorflow/core/lib/gtl/inlined_vector.h" #include "tensorflow/core/lib/gtl/stl_util.h" #include "tensorflow/core/platform/port.h" -#include namespace tensorflow { namespace gtl { diff --git a/tensorflow/core/lib/gtl/edit_distance_test.cc b/tensorflow/core/lib/gtl/edit_distance_test.cc index 0526ee0a05a..feab2c43471 100644 --- a/tensorflow/core/lib/gtl/edit_distance_test.cc +++ b/tensorflow/core/lib/gtl/edit_distance_test.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/lib/gtl/edit_distance.h" +#include #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { namespace gtl { diff --git a/tensorflow/core/lib/gtl/inlined_vector.h b/tensorflow/core/lib/gtl/inlined_vector.h index c23075129cb..58cd6e6a084 100644 --- a/tensorflow/core/lib/gtl/inlined_vector.h +++ b/tensorflow/core/lib/gtl/inlined_vector.h @@ -25,9 +25,9 @@ #include #include +#include "tensorflow/core/lib/gtl/manual_constructor.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/lib/gtl/manual_constructor.h" #include // NOLINT(build/include_order) diff --git a/tensorflow/core/lib/gtl/inlined_vector_test.cc b/tensorflow/core/lib/gtl/inlined_vector_test.cc index ec5fe1eaa80..c811893023c 100644 --- a/tensorflow/core/lib/gtl/inlined_vector_test.cc +++ b/tensorflow/core/lib/gtl/inlined_vector_test.cc @@ -5,10 +5,10 @@ #include #include +#include #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/lib/gtl/int_type_test.cc b/tensorflow/core/lib/gtl/int_type_test.cc index 694886d3455..14f39ecbdea 100644 --- a/tensorflow/core/lib/gtl/int_type_test.cc +++ b/tensorflow/core/lib/gtl/int_type_test.cc @@ -3,9 +3,9 @@ #include #include -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/lib/gtl/int_type.h" #include +#include "tensorflow/core/lib/gtl/int_type.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/lib/gtl/iterator_range_test.cc b/tensorflow/core/lib/gtl/iterator_range_test.cc index 328be4ecbce..6922142d8cc 100644 --- a/tensorflow/core/lib/gtl/iterator_range_test.cc +++ b/tensorflow/core/lib/gtl/iterator_range_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/lib/gtl/iterator_range.h" #include -#include "tensorflow/core/platform/port.h" #include +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace gtl { diff --git a/tensorflow/core/lib/gtl/manual_constructor_test.cc b/tensorflow/core/lib/gtl/manual_constructor_test.cc index a929591be21..b5ecca7c82f 100644 --- a/tensorflow/core/lib/gtl/manual_constructor_test.cc +++ b/tensorflow/core/lib/gtl/manual_constructor_test.cc @@ -2,8 +2,8 @@ #include -#include "tensorflow/core/platform/logging.h" #include +#include "tensorflow/core/platform/logging.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/lib/hash/hash.cc b/tensorflow/core/lib/hash/hash.cc index 075d2524120..6612458150e 100644 --- a/tensorflow/core/lib/hash/hash.cc +++ b/tensorflow/core/lib/hash/hash.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/lib/hash/hash.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/raw_coding.h" +#include "tensorflow/core/platform/port.h" #include diff --git a/tensorflow/core/lib/hash/hash_test.cc b/tensorflow/core/lib/hash/hash_test.cc index 9d3b970f3bb..456bdae2dc4 100644 --- a/tensorflow/core/lib/hash/hash_test.cc +++ b/tensorflow/core/lib/hash/hash_test.cc @@ -1,9 +1,9 @@ #include +#include #include "tensorflow/core/lib/hash/hash.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/lib/histogram/histogram_test.cc b/tensorflow/core/lib/histogram/histogram_test.cc index ede44fe85ba..bd42f516799 100644 --- a/tensorflow/core/lib/histogram/histogram_test.cc +++ b/tensorflow/core/lib/histogram/histogram_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/lib/histogram/histogram.h" #include -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/framework/summary.pb.h" #include +#include "tensorflow/core/framework/summary.pb.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { namespace histogram { diff --git a/tensorflow/core/lib/io/block.cc b/tensorflow/core/lib/io/block.cc index 1ddaa2eb788..69c62a93472 100644 --- a/tensorflow/core/lib/io/block.cc +++ b/tensorflow/core/lib/io/block.cc @@ -6,12 +6,12 @@ #include "tensorflow/core/lib/io/block.h" -#include #include -#include "tensorflow/core/lib/io/format.h" +#include #include "tensorflow/core/lib/core/coding.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/lib/io/format.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { namespace table { diff --git a/tensorflow/core/lib/io/block_builder.cc b/tensorflow/core/lib/io/block_builder.cc index d94048d744c..0c9671dcb4b 100644 --- a/tensorflow/core/lib/io/block_builder.cc +++ b/tensorflow/core/lib/io/block_builder.cc @@ -28,10 +28,10 @@ #include "tensorflow/core/lib/io/block_builder.h" -#include #include -#include "tensorflow/core/lib/io/table_builder.h" +#include #include "tensorflow/core/lib/core/coding.h" +#include "tensorflow/core/lib/io/table_builder.h" namespace tensorflow { namespace table { diff --git a/tensorflow/core/lib/io/format.cc b/tensorflow/core/lib/io/format.cc index 259cfc13dc0..fc43d8aeead 100644 --- a/tensorflow/core/lib/io/format.cc +++ b/tensorflow/core/lib/io/format.cc @@ -4,12 +4,12 @@ #include "tensorflow/core/lib/io/format.h" -#include "tensorflow/core/public/env.h" -#include "tensorflow/core/lib/io/block.h" #include "tensorflow/core/lib/core/coding.h" -#include "tensorflow/core/lib/hash/crc32c.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/lib/hash/crc32c.h" +#include "tensorflow/core/lib/io/block.h" +#include "tensorflow/core/platform/port.h" +#include "tensorflow/core/public/env.h" namespace tensorflow { namespace table { @@ -65,7 +65,7 @@ Status Footer::DecodeFrom(StringPiece* input) { } Status ReadBlock(RandomAccessFile* file, const BlockHandle& handle, - BlockContents* result) { + BlockContents* result) { result->data = StringPiece(); result->cachable = false; result->heap_allocated = false; @@ -75,8 +75,7 @@ Status ReadBlock(RandomAccessFile* file, const BlockHandle& handle, size_t n = static_cast(handle.size()); char* buf = new char[n + kBlockTrailerSize]; StringPiece contents; - Status s = - file->Read(handle.offset(), n + kBlockTrailerSize, &contents, buf); + Status s = file->Read(handle.offset(), n + kBlockTrailerSize, &contents, buf); if (!s.ok()) { delete[] buf; return s; diff --git a/tensorflow/core/lib/io/format.h b/tensorflow/core/lib/io/format.h index 3121c41bb84..b9eeef65ab2 100644 --- a/tensorflow/core/lib/io/format.h +++ b/tensorflow/core/lib/io/format.h @@ -5,11 +5,11 @@ #ifndef TENSORFLOW_LIB_IO_FORMAT_H_ #define TENSORFLOW_LIB_IO_FORMAT_H_ -#include #include +#include #include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/io/table_builder.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { class RandomAccessFile; @@ -86,7 +86,7 @@ struct BlockContents { // Read the block identified by "handle" from "file". On failure // return non-OK. On success fill *result and return OK. extern Status ReadBlock(RandomAccessFile* file, const BlockHandle& handle, - BlockContents* result); + BlockContents* result); // Implementation details follow. Clients should ignore, diff --git a/tensorflow/core/lib/io/inputbuffer.h b/tensorflow/core/lib/io/inputbuffer.h index 6879f305670..8df2dd6fb08 100644 --- a/tensorflow/core/lib/io/inputbuffer.h +++ b/tensorflow/core/lib/io/inputbuffer.h @@ -2,8 +2,8 @@ #define TENSORFLOW_LIB_IO_INPUTBUFFER_H_ #include -#include "tensorflow/core/public/env.h" #include "tensorflow/core/platform/port.h" +#include "tensorflow/core/public/env.h" #include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/lib/io/inputbuffer_test.cc b/tensorflow/core/lib/io/inputbuffer_test.cc index 34094f018c2..43229df1b08 100644 --- a/tensorflow/core/lib/io/inputbuffer_test.cc +++ b/tensorflow/core/lib/io/inputbuffer_test.cc @@ -2,13 +2,13 @@ #include "tensorflow/core/public/env.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/strings/strcat.h" #include -#include "tensorflow/core/public/status.h" +#include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" +#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/test.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/lib/io/match.cc b/tensorflow/core/lib/io/match.cc index 1563642d0ba..7a116e42fb0 100644 --- a/tensorflow/core/lib/io/match.cc +++ b/tensorflow/core/lib/io/match.cc @@ -7,7 +7,7 @@ namespace tensorflow { namespace io { Status GetMatchingFiles(Env* env, const string& pattern, - std::vector* results) { + std::vector* results) { results->clear(); std::vector all_files; string dir = Dirname(pattern).ToString(); diff --git a/tensorflow/core/lib/io/match.h b/tensorflow/core/lib/io/match.h index fd194178e72..14a8fd49f09 100644 --- a/tensorflow/core/lib/io/match.h +++ b/tensorflow/core/lib/io/match.h @@ -3,8 +3,8 @@ #include #include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/public/status.h" #include "tensorflow/core/public/env.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { class Env; @@ -16,7 +16,7 @@ namespace io { // successful, return Status::OK and store the matching files in // "*results". Otherwise, return a non-OK status. Status GetMatchingFiles(Env* env, const string& pattern, - std::vector* results); + std::vector* results); } // namespace io } // namespace tensorflow diff --git a/tensorflow/core/lib/io/match_test.cc b/tensorflow/core/lib/io/match_test.cc index aaa56e4e7e8..82557c25d08 100644 --- a/tensorflow/core/lib/io/match_test.cc +++ b/tensorflow/core/lib/io/match_test.cc @@ -1,11 +1,11 @@ #include +#include #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/io/match.h" #include "tensorflow/core/lib/io/path.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/public/env.h" -#include namespace tensorflow { namespace io { diff --git a/tensorflow/core/lib/io/record_reader.cc b/tensorflow/core/lib/io/record_reader.cc index 2f0fabff634..4cc49ec1208 100644 --- a/tensorflow/core/lib/io/record_reader.cc +++ b/tensorflow/core/lib/io/record_reader.cc @@ -1,10 +1,10 @@ #include "tensorflow/core/lib/io/record_reader.h" #include -#include "tensorflow/core/public/env.h" #include "tensorflow/core/lib/core/coding.h" -#include "tensorflow/core/lib/hash/crc32c.h" #include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/lib/hash/crc32c.h" +#include "tensorflow/core/public/env.h" namespace tensorflow { namespace io { @@ -16,9 +16,8 @@ RecordReader::~RecordReader() {} // Read n+4 bytes from file, verify that checksum of first n bytes is // stored in the last 4 bytes and store the first n bytes in *result. // May use *storage as backing store. -static Status ReadChecksummed(RandomAccessFile* file, uint64 offset, - size_t n, StringPiece* result, - string* storage) { +static Status ReadChecksummed(RandomAccessFile* file, uint64 offset, size_t n, + StringPiece* result, string* storage) { if (n >= SIZE_MAX - sizeof(uint32)) { return errors::DataLoss("record size too large"); } diff --git a/tensorflow/core/lib/io/record_writer.cc b/tensorflow/core/lib/io/record_writer.cc index 3d7f1509ab1..3eb4866f71a 100644 --- a/tensorflow/core/lib/io/record_writer.cc +++ b/tensorflow/core/lib/io/record_writer.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/lib/io/record_writer.h" -#include "tensorflow/core/public/env.h" #include "tensorflow/core/lib/core/coding.h" #include "tensorflow/core/lib/hash/crc32c.h" +#include "tensorflow/core/public/env.h" namespace tensorflow { namespace io { diff --git a/tensorflow/core/lib/io/recordio_test.cc b/tensorflow/core/lib/io/recordio_test.cc index 3e9c8164431..82c1aca4cc9 100644 --- a/tensorflow/core/lib/io/recordio_test.cc +++ b/tensorflow/core/lib/io/recordio_test.cc @@ -57,7 +57,7 @@ class RecordioTest : public testing::Test { StringSource() : force_error_(false), returned_partial_(false) {} Status Read(uint64 offset, size_t n, StringPiece* result, - char* scratch) const override { + char* scratch) const override { EXPECT_FALSE(returned_partial_) << "must not Read() after eof/error"; if (force_error_) { diff --git a/tensorflow/core/lib/io/table.cc b/tensorflow/core/lib/io/table.cc index 769d7e72a50..8bdb80e4d2d 100644 --- a/tensorflow/core/lib/io/table.cc +++ b/tensorflow/core/lib/io/table.cc @@ -27,8 +27,8 @@ struct Table::Rep { Block* index_block; }; -Status Table::Open(const Options& options, RandomAccessFile* file, - uint64 size, Table** table) { +Status Table::Open(const Options& options, RandomAccessFile* file, uint64 size, + Table** table) { *table = NULL; if (size < Footer::kEncodedLength) { return errors::DataLoss("file is too short to be an sstable"); @@ -36,9 +36,8 @@ Status Table::Open(const Options& options, RandomAccessFile* file, char footer_space[Footer::kEncodedLength]; StringPiece footer_input; - Status s = - file->Read(size - Footer::kEncodedLength, Footer::kEncodedLength, - &footer_input, footer_space); + Status s = file->Read(size - Footer::kEncodedLength, Footer::kEncodedLength, + &footer_input, footer_space); if (!s.ok()) return s; Footer footer; @@ -117,8 +116,8 @@ Iterator* Table::NewIterator() const { } Status Table::InternalGet(const StringPiece& k, void* arg, - void (*saver)(void*, const StringPiece&, - const StringPiece&)) { + void (*saver)(void*, const StringPiece&, + const StringPiece&)) { Status s; Iterator* iiter = rep_->index_block->NewIterator(); iiter->Seek(k); diff --git a/tensorflow/core/lib/io/table.h b/tensorflow/core/lib/io/table.h index 230dded2d4c..6f3d52ad41b 100644 --- a/tensorflow/core/lib/io/table.h +++ b/tensorflow/core/lib/io/table.h @@ -34,7 +34,7 @@ class Table { // "*file", but the client must ensure that "file" remains live // for the duration of the returned table's lifetime. static Status Open(const Options& options, RandomAccessFile* file, - uint64 file_size, Table** table); + uint64 file_size, Table** table); ~Table(); @@ -62,8 +62,8 @@ class Table { // to Seek(key). May not make such a call if filter policy says // that key is not present. Status InternalGet(const StringPiece& key, void* arg, - void (*handle_result)(void* arg, const StringPiece& k, - const StringPiece& v)); + void (*handle_result)(void* arg, const StringPiece& k, + const StringPiece& v)); // No copying allowed Table(const Table&); diff --git a/tensorflow/core/lib/io/table_builder.cc b/tensorflow/core/lib/io/table_builder.cc index b786888b300..d19bc64ac06 100644 --- a/tensorflow/core/lib/io/table_builder.cc +++ b/tensorflow/core/lib/io/table_builder.cc @@ -5,13 +5,13 @@ #include "tensorflow/core/lib/io/table_builder.h" #include +#include "tensorflow/core/lib/core/coding.h" +#include "tensorflow/core/lib/core/errors.h" +#include "tensorflow/core/lib/hash/crc32c.h" #include "tensorflow/core/lib/io/block_builder.h" #include "tensorflow/core/lib/io/format.h" #include "tensorflow/core/lib/io/table_options.h" -#include "tensorflow/core/lib/core/coding.h" -#include "tensorflow/core/lib/hash/crc32c.h" #include "tensorflow/core/public/env.h" -#include "tensorflow/core/lib/core/errors.h" namespace tensorflow { namespace table { diff --git a/tensorflow/core/lib/io/table_test.cc b/tensorflow/core/lib/io/table_test.cc index 66e90ac64e8..3c5a9ecbc1e 100644 --- a/tensorflow/core/lib/io/table_test.cc +++ b/tensorflow/core/lib/io/table_test.cc @@ -100,7 +100,7 @@ class StringSource : public RandomAccessFile { uint64 Size() const { return contents_.size(); } virtual Status Read(uint64 offset, size_t n, StringPiece* result, - char* scratch) const { + char* scratch) const { if (offset > contents_.size()) { return errors::InvalidArgument("invalid Read offset"); } diff --git a/tensorflow/core/lib/io/two_level_iterator.cc b/tensorflow/core/lib/io/two_level_iterator.cc index 409baade6d1..b71d1077074 100644 --- a/tensorflow/core/lib/io/two_level_iterator.cc +++ b/tensorflow/core/lib/io/two_level_iterator.cc @@ -4,10 +4,10 @@ #include "tensorflow/core/lib/io/two_level_iterator.h" -#include "tensorflow/core/lib/io/table.h" #include "tensorflow/core/lib/io/block.h" #include "tensorflow/core/lib/io/format.h" #include "tensorflow/core/lib/io/iterator.h" +#include "tensorflow/core/lib/io/table.h" namespace tensorflow { namespace table { diff --git a/tensorflow/core/lib/jpeg/jpeg_handle.h b/tensorflow/core/lib/jpeg/jpeg_handle.h index 58f7f6f666e..040e12c4953 100644 --- a/tensorflow/core/lib/jpeg/jpeg_handle.h +++ b/tensorflow/core/lib/jpeg/jpeg_handle.h @@ -5,9 +5,9 @@ #define TENSORFLOW_LIB_JPEG_JPEG_HANDLE_H_ extern "C" { +#include "external/jpeg_archive/jpeg-9a/jerror.h" #include "external/jpeg_archive/jpeg-9a/jinclude.h" #include "external/jpeg_archive/jpeg-9a/jpeglib.h" -#include "external/jpeg_archive/jpeg-9a/jerror.h" #include "external/jpeg_archive/jpeg-9a/transupp.h" // for rotations } diff --git a/tensorflow/core/lib/jpeg/jpeg_mem.h b/tensorflow/core/lib/jpeg/jpeg_mem.h index 19ba7d4acfd..a608cfcd2fc 100644 --- a/tensorflow/core/lib/jpeg/jpeg_mem.h +++ b/tensorflow/core/lib/jpeg/jpeg_mem.h @@ -10,8 +10,8 @@ #include #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/stringpiece.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace jpeg { diff --git a/tensorflow/core/lib/jpeg/jpeg_mem_unittest.cc b/tensorflow/core/lib/jpeg/jpeg_mem_unittest.cc index 23e72f9d576..1b47b084204 100644 --- a/tensorflow/core/lib/jpeg/jpeg_mem_unittest.cc +++ b/tensorflow/core/lib/jpeg/jpeg_mem_unittest.cc @@ -7,11 +7,11 @@ #include +#include #include "tensorflow/core/lib/jpeg/jpeg_handle.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/env.h" -#include #include "tensorflow/core/lib/core/casts.h" diff --git a/tensorflow/core/lib/png/png_io.cc b/tensorflow/core/lib/png/png_io.cc index 43b84e41e0f..f967dfd68a8 100644 --- a/tensorflow/core/lib/png/png_io.cc +++ b/tensorflow/core/lib/png/png_io.cc @@ -8,11 +8,11 @@ // NOTE(skal): we don't '#include ' before png/png.h as it otherwise // provokes a compile error. We instead let png.h include what is needed. +#include "external/png_archive/libpng-1.2.53/png.h" #include "tensorflow/core/lib/core/casts.h" #include "tensorflow/core/lib/png/png_io.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" // endian -#include "external/png_archive/libpng-1.2.53/png.h" namespace tensorflow { namespace png { @@ -23,10 +23,11 @@ namespace png { namespace { -#define PTR_INC(type, ptr, del) (ptr = \ - reinterpret_cast(reinterpret_cast(ptr) + (del))) -#define CPTR_INC(type, ptr, del) (ptr = \ - reinterpret_cast(reinterpret_cast(ptr) + (del))) +#define PTR_INC(type, ptr, del) \ + (ptr = reinterpret_cast(reinterpret_cast(ptr) + (del))) +#define CPTR_INC(type, ptr, del) \ + (ptr = reinterpret_cast(reinterpret_cast(ptr) + \ + (del))) // Convert from 8 bit components to 16. This works in-place. static void Convert8to16(const uint8* p8, int num_comps, int p8_row_bytes, @@ -34,14 +35,13 @@ static void Convert8to16(const uint8* p8, int num_comps, int p8_row_bytes, int p16_row_bytes) { // Adjust pointers to copy backwards width *= num_comps; - CPTR_INC(uint8, p8, (height - 1) * p8_row_bytes + - (width - 1) * sizeof(*p8)); - PTR_INC(uint16, p16, (height - 1) * p16_row_bytes + - (width - 1) * sizeof(*p16)); - int bump8 = width * sizeof(*p8) - p8_row_bytes; + CPTR_INC(uint8, p8, (height - 1) * p8_row_bytes + (width - 1) * sizeof(*p8)); + PTR_INC(uint16, p16, + (height - 1) * p16_row_bytes + (width - 1) * sizeof(*p16)); + int bump8 = width * sizeof(*p8) - p8_row_bytes; int bump16 = width * sizeof(*p16) - p16_row_bytes; for (; height-- != 0; - CPTR_INC(uint8, p8, bump8), PTR_INC(uint16, p16, bump16)) { + CPTR_INC(uint8, p8, bump8), PTR_INC(uint16, p16, bump16)) { for (int w = width; w-- != 0; --p8, --p16) { uint pix = *p8; pix |= pix << 8; @@ -65,8 +65,7 @@ void WarningHandler(png_structp png_ptr, png_const_charp msg) { LOG(WARNING) << "PNG warning: " << msg; } -void StringReader(png_structp png_ptr, - png_bytep data, png_size_t length) { +void StringReader(png_structp png_ptr, png_bytep data, png_size_t length) { DecodeContext* const ctx = bit_cast(png_get_io_ptr(png_ptr)); if (static_cast(ctx->data_left) < length) { if (!ctx->error_condition) { @@ -86,8 +85,7 @@ void StringWriter(png_structp png_ptr, png_bytep data, png_size_t length) { s->append(bit_cast(data), length); } -void StringWriterFlush(png_structp png_ptr) { -} +void StringWriterFlush(png_structp png_ptr) {} char* check_metadata_string(const string& s) { const char* const c_string = s.c_str(); @@ -195,10 +193,9 @@ bool CommonInitDecode(StringPiece png_string, int desired_channels, context->data_left = png_string.size(); png_set_read_fn(context->png_ptr, context, StringReader); png_read_info(context->png_ptr, context->info_ptr); - png_get_IHDR(context->png_ptr, context->info_ptr, - &context->width, &context->height, - &context->bit_depth, &context->color_type, - 0, 0, 0); + png_get_IHDR(context->png_ptr, context->info_ptr, &context->width, + &context->height, &context->bit_depth, &context->color_type, 0, + 0, 0); if (context->error_condition) { VLOG(1) << ": DecodePNG <- error during header parsing."; CommonFreeDecode(context); @@ -219,12 +216,12 @@ bool CommonInitDecode(StringPiece png_string, int desired_channels, } else if (has_tRNS) { png_set_tRNS_to_alpha(context->png_ptr); // Convert transparency to alpha } else { - png_set_add_alpha( - context->png_ptr, (1 << context->bit_depth) - 1, PNG_FILLER_AFTER); + png_set_add_alpha(context->png_ptr, (1 << context->bit_depth) - 1, + PNG_FILLER_AFTER); } - } else { // We don't want alpha - if (has_alpha || has_tRNS) { // There is alpha - png_set_strip_alpha(context->png_ptr); // Strip alpha + } else { // We don't want alpha + if (has_alpha || has_tRNS) { // There is alpha + png_set_strip_alpha(context->png_ptr); // Strip alpha } } @@ -240,25 +237,23 @@ bool CommonInitDecode(StringPiece png_string, int desired_channels, png_read_update_info(context->png_ptr, context->info_ptr); #ifdef IS_LITTLE_ENDIAN - if (desired_channel_bits > 8) - png_set_swap(context->png_ptr); + if (desired_channel_bits > 8) png_set_swap(context->png_ptr); #endif // IS_LITTLE_ENDIAN // convert palette to rgb(a) if needs be. if (context->color_type == PNG_COLOR_TYPE_PALETTE) - png_set_palette_to_rgb(context->png_ptr); + png_set_palette_to_rgb(context->png_ptr); // handle grayscale case for source or destination const bool want_gray = (context->channels < 3); const bool is_gray = !(context->color_type & PNG_COLOR_MASK_COLOR); - if (is_gray) { // upconvert gray to 8-bit if needed. - if (context->bit_depth < 8) - png_set_gray_1_2_4_to_8(context->png_ptr); + if (is_gray) { // upconvert gray to 8-bit if needed. + if (context->bit_depth < 8) png_set_gray_1_2_4_to_8(context->png_ptr); } - if (want_gray) { // output is grayscale + if (want_gray) { // output is grayscale if (!is_gray) - png_set_rgb_to_gray(context->png_ptr, 1, 0.299, 0.587); // 601, JPG - } else { // output is rgb(a) + png_set_rgb_to_gray(context->png_ptr, 1, 0.299, 0.587); // 601, JPG + } else { // output is rgb(a) if (is_gray) png_set_gray_to_rgb(context->png_ptr); // Enable gray -> RGB conversion } @@ -306,14 +301,12 @@ bool WriteImageToBuffer( CHECK_NOTNULL(png_string); // Although this case is checked inside png.cc and issues an error message, // that error causes memory corruption. - if (width == 0 || height == 0) - return false; + if (width == 0 || height == 0) return false; png_string->resize(0); png_infop info_ptr = NULL; - png_structp png_ptr = - png_create_write_struct(PNG_LIBPNG_VER_STRING, - NULL, ErrorHandler, WarningHandler); + png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, + ErrorHandler, WarningHandler); if (png_ptr == NULL) return false; if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_write_struct(&png_ptr, info_ptr ? &info_ptr : NULL); @@ -369,8 +362,7 @@ bool WriteImageToBuffer( png_write_info(png_ptr, info_ptr); #ifdef IS_LITTLE_ENDIAN - if (channel_bits > 8) - png_set_swap(png_ptr); + if (channel_bits > 8) png_set_swap(png_ptr); #endif // IS_LITTLE_ENDIAN png_byte* row = reinterpret_cast(const_cast(image)); diff --git a/tensorflow/core/lib/png/png_io.h b/tensorflow/core/lib/png/png_io.h index df9bff7be83..ddfbf9304f1 100644 --- a/tensorflow/core/lib/png/png_io.h +++ b/tensorflow/core/lib/png/png_io.h @@ -20,8 +20,8 @@ #include #include -#include "tensorflow/core/lib/core/stringpiece.h" #include "external/png_archive/libpng-1.2.53/png.h" +#include "tensorflow/core/lib/core/stringpiece.h" namespace tensorflow { namespace png { @@ -29,13 +29,13 @@ namespace png { // Handy container for decoding informations and struct pointers struct DecodeContext { const uint8* data; - int data_left; + int data_left; png_structp png_ptr; - png_infop info_ptr; + png_infop info_ptr; png_uint_32 width, height; - int num_passes; - int color_type; - int bit_depth; + int num_passes; + int color_type; + int bit_depth; int channels; bool need_to_synthesize_16; bool error_condition; diff --git a/tensorflow/core/lib/random/distribution_sampler_test.cc b/tensorflow/core/lib/random/distribution_sampler_test.cc index d61a8daa0fb..657c65120d5 100644 --- a/tensorflow/core/lib/random/distribution_sampler_test.cc +++ b/tensorflow/core/lib/random/distribution_sampler_test.cc @@ -4,11 +4,11 @@ #include #include +#include +#include "tensorflow/core/lib/random/simple_philox.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" -#include "tensorflow/core/lib/random/simple_philox.h" -#include namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/random/philox_random_test.cc b/tensorflow/core/lib/random/philox_random_test.cc index 997c0263b7f..f656fe9f02c 100644 --- a/tensorflow/core/lib/random/philox_random_test.cc +++ b/tensorflow/core/lib/random/philox_random_test.cc @@ -6,11 +6,11 @@ #include #include -#include "tensorflow/core/platform/logging.h" +#include #include "tensorflow/core/lib/random/philox_random_test_utils.h" #include "tensorflow/core/lib/random/random.h" #include "tensorflow/core/lib/random/random_distributions.h" -#include +#include "tensorflow/core/platform/logging.h" namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/random/random_distributions_test.cc b/tensorflow/core/lib/random/random_distributions_test.cc index 3ce86a907aa..87a23dcc5cb 100644 --- a/tensorflow/core/lib/random/random_distributions_test.cc +++ b/tensorflow/core/lib/random/random_distributions_test.cc @@ -6,11 +6,11 @@ #include #include +#include #include "tensorflow/core/lib/random/philox_random.h" #include "tensorflow/core/lib/random/philox_random_test_utils.h" #include "tensorflow/core/lib/random/random.h" #include "tensorflow/core/platform/logging.h" -#include namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/random/random_test.cc b/tensorflow/core/lib/random/random_test.cc index 7ed37c8b5e9..7284d5adc7f 100644 --- a/tensorflow/core/lib/random/random_test.cc +++ b/tensorflow/core/lib/random/random_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/lib/random/random.h" #include -#include "tensorflow/core/platform/port.h" #include +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/random/simple_philox_test.cc b/tensorflow/core/lib/random/simple_philox_test.cc index 4246b8b4dd0..7db63b2346f 100644 --- a/tensorflow/core/lib/random/simple_philox_test.cc +++ b/tensorflow/core/lib/random/simple_philox_test.cc @@ -3,9 +3,9 @@ #include #include +#include #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" -#include namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/random/weighted_picker_test.cc b/tensorflow/core/lib/random/weighted_picker_test.cc index 0b27d437d57..28dc90ad84f 100644 --- a/tensorflow/core/lib/random/weighted_picker_test.cc +++ b/tensorflow/core/lib/random/weighted_picker_test.cc @@ -3,12 +3,12 @@ #include #include +#include +#include "tensorflow/core/lib/random/simple_philox.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" -#include "tensorflow/core/lib/random/simple_philox.h" -#include namespace tensorflow { namespace random { diff --git a/tensorflow/core/lib/strings/numbers.cc b/tensorflow/core/lib/strings/numbers.cc index d61129fb3f9..e756d3836ae 100644 --- a/tensorflow/core/lib/strings/numbers.cc +++ b/tensorflow/core/lib/strings/numbers.cc @@ -6,8 +6,8 @@ #include #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace strings { diff --git a/tensorflow/core/lib/strings/str_util.h b/tensorflow/core/lib/strings/str_util.h index 34ea462b2d4..c19632792d6 100644 --- a/tensorflow/core/lib/strings/str_util.h +++ b/tensorflow/core/lib/strings/str_util.h @@ -2,10 +2,10 @@ #define TENSORFLOW_LIB_STRINGS_STR_UTIL_H_ #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/array_slice.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/port.h" // Basic string utility routines namespace tensorflow { diff --git a/tensorflow/core/lib/strings/strcat.cc b/tensorflow/core/lib/strings/strcat.cc index e564b9eb735..33a491bd02a 100644 --- a/tensorflow/core/lib/strings/strcat.cc +++ b/tensorflow/core/lib/strings/strcat.cc @@ -5,8 +5,8 @@ #include #include -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/gtl/stl_util.h" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { namespace strings { diff --git a/tensorflow/core/lib/strings/strcat.h b/tensorflow/core/lib/strings/strcat.h index 763ad8368a8..815f1dce134 100644 --- a/tensorflow/core/lib/strings/strcat.h +++ b/tensorflow/core/lib/strings/strcat.h @@ -65,8 +65,7 @@ struct Hex { uint64 value; enum PadSpec spec; template - explicit Hex(Int v, PadSpec s = NO_PAD) - : spec(s) { + explicit Hex(Int v, PadSpec s = NO_PAD) : spec(s) { // Prevent sign-extension by casting integers to // their unsigned counterparts. static_assert( diff --git a/tensorflow/core/lib/strings/strcat_test.cc b/tensorflow/core/lib/strings/strcat_test.cc index 9ff7d81af92..faaf4277aa1 100644 --- a/tensorflow/core/lib/strings/strcat_test.cc +++ b/tensorflow/core/lib/strings/strcat_test.cc @@ -2,9 +2,9 @@ #include +#include #include "tensorflow/core/lib/strings/stringprintf.h" #include "tensorflow/core/platform/port.h" -#include namespace tensorflow { namespace strings { diff --git a/tensorflow/core/platform/default/tracing_impl.h b/tensorflow/core/platform/default/tracing_impl.h index e2f5d3cb3f7..78848d0c8e5 100644 --- a/tensorflow/core/platform/default/tracing_impl.h +++ b/tensorflow/core/platform/default/tracing_impl.h @@ -3,10 +3,10 @@ // Stub implementations of tracing functionality. -#include "tensorflow/core/public/status.h" #include "tensorflow/core/lib/core/threadpool.h" #include "tensorflow/core/lib/random/random.h" #include "tensorflow/core/platform/tracing.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { namespace port { diff --git a/tensorflow/core/platform/env_test.cc b/tensorflow/core/platform/env_test.cc index be15c4a5cb1..b3ee24049df 100644 --- a/tensorflow/core/platform/env_test.cc +++ b/tensorflow/core/platform/env_test.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/public/env.h" +#include #include "tensorflow/core/lib/io/path.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/test.h" -#include namespace tensorflow { diff --git a/tensorflow/core/platform/port.h b/tensorflow/core/platform/port.h index fef20f7753b..0f668268e94 100644 --- a/tensorflow/core/platform/port.h +++ b/tensorflow/core/platform/port.h @@ -34,14 +34,14 @@ enum ConditionResult { kCond_Timeout, kCond_MaybeNotified }; // Include appropriate platform-dependent implementations of mutex etc. #if defined(PLATFORM_GOOGLE) +#include "tensorflow/core/platform/google/dynamic_annotations.h" #include "tensorflow/core/platform/google/integral_types.h" #include "tensorflow/core/platform/google/mutex.h" -#include "tensorflow/core/platform/google/dynamic_annotations.h" #elif defined(PLATFORM_POSIX) || defined(PLATFORM_POSIX_ANDROID) || \ defined(PLATFORM_GOOGLE_ANDROID) +#include "tensorflow/core/platform/default/dynamic_annotations.h" #include "tensorflow/core/platform/default/integral_types.h" #include "tensorflow/core/platform/default/mutex.h" -#include "tensorflow/core/platform/default/dynamic_annotations.h" #else #error Define the appropriate PLATFORM_ macro for this platform #endif diff --git a/tensorflow/core/platform/port_test.cc b/tensorflow/core/platform/port_test.cc index 8cf1c30aa36..b22e700cd4c 100644 --- a/tensorflow/core/platform/port_test.cc +++ b/tensorflow/core/platform/port_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/platform/port.h" #include -#include "tensorflow/core/lib/core/threadpool.h" #include +#include "tensorflow/core/lib/core/threadpool.h" namespace tensorflow { namespace port { diff --git a/tensorflow/core/platform/posix/env.cc b/tensorflow/core/platform/posix/env.cc index 6ba2010005e..d7919445fa2 100644 --- a/tensorflow/core/platform/posix/env.cc +++ b/tensorflow/core/platform/posix/env.cc @@ -10,9 +10,9 @@ #include -#include "tensorflow/core/public/env.h" #include "tensorflow/core/lib/core/error_codes.pb.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/public/env.h" namespace tensorflow { @@ -113,7 +113,7 @@ error::Code ErrnoToCode(int err_number) { case ENOLCK: // No locks available case ENOLINK: // Link has been severed #if !defined(__APPLE__) - case ENONET: // Machine is not on the network + case ENONET: // Machine is not on the network #endif code = error::UNAVAILABLE; break; diff --git a/tensorflow/core/platform/tracing.h b/tensorflow/core/platform/tracing.h index 09f8d722df2..4e8e392531a 100644 --- a/tensorflow/core/platform/tracing.h +++ b/tensorflow/core/platform/tracing.h @@ -6,8 +6,8 @@ #include #include -#include "tensorflow/core/platform/port.h" // Must be first #include "tensorflow/core/lib/core/stringpiece.h" +#include "tensorflow/core/platform/port.h" // Must be first #include "tensorflow/core/platform/thread_annotations.h" namespace tensorflow { diff --git a/tensorflow/core/public/README.md b/tensorflow/core/public/README.md index b1afff87de5..d5051ae690f 100644 --- a/tensorflow/core/public/README.md +++ b/tensorflow/core/public/README.md @@ -10,16 +10,13 @@ The following is an example python code to do a simple matrix multiply of two constants and get the result from a locally-running TensorFlow process. -First, bring in the following dependency: +First, bring in tensorflow python dependency -//third_party/tensorflow/core/public:tensorflow_py +//third_party/tensorflow:tensorflow_py -to get the python TensorFlow API. If you intend to run TensorFlow within -the same process, link in the following to the same binary: +to get the python TensorFlow API. -//third_party/tensorflow/core/public:tensorflow_std_ops - -to get the standard set of op implementations. Then: +Then: ```python import tensorflow as tf @@ -38,11 +35,11 @@ with tf.Session("local"): If you are running TensorFlow locally, link your binary with -//third_party/tensorflow/core/public:tensorflow_local +//third_party/tensorflow/core and link in the operation implementations you want to supported, e.g., -//third_party/tensorflow/core/public:tensorflow_std_ops +//third_party/tensorflow/core:kernels An example program to take a GraphDef and run it using TensorFlow using the C++ Session API: diff --git a/tensorflow/core/public/env.h b/tensorflow/core/public/env.h index 06dab3dc568..c260aef3b09 100644 --- a/tensorflow/core/public/env.h +++ b/tensorflow/core/public/env.h @@ -1,13 +1,13 @@ #ifndef TENSORFLOW_PUBLIC_ENV_H_ #define TENSORFLOW_PUBLIC_ENV_H_ +#include #include #include -#include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/public/status.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/public/status.h" namespace tensorflow { @@ -19,7 +19,7 @@ class WritableFile; /// \brief An interface used by the tensorflow implementation to /// access operating system functionality like the filesystem etc. /// -/// Callers may wish to provide a custom Env object to get fine grain +/// Callers may wish to provide a custom Env object to get fine grain /// control. /// /// All Env implementations are safe for concurrent access from @@ -48,7 +48,7 @@ class Env { /// /// The returned file may be concurrently accessed by multiple threads. virtual Status NewRandomAccessFile(const string& fname, - RandomAccessFile** result) = 0; + RandomAccessFile** result) = 0; /// \brief Creates an object that writes to a new file with the specified /// name. @@ -60,7 +60,7 @@ class Env { /// /// The returned file will only be accessed by one thread at a time. virtual Status NewWritableFile(const string& fname, - WritableFile** result) = 0; + WritableFile** result) = 0; /// \brief Creates an object that either appends to an existing file, or /// writes to a new file (if the file does not exist to begin with). @@ -71,7 +71,7 @@ class Env { /// /// The returned file will only be accessed by one thread at a time. virtual Status NewAppendableFile(const string& fname, - WritableFile** result) = 0; + WritableFile** result) = 0; /// Returns true iff the named file exists. virtual bool FileExists(const string& fname) = 0; @@ -81,7 +81,7 @@ class Env { /// /// Original contents of *results are dropped. virtual Status GetChildren(const string& dir, - std::vector* result) = 0; + std::vector* result) = 0; /// Deletes the named file. virtual Status DeleteFile(const string& fname) = 0; @@ -147,7 +147,7 @@ class RandomAccessFile { /// /// Safe for concurrent use by multiple threads. virtual Status Read(uint64 offset, size_t n, StringPiece* result, - char* scratch) const = 0; + char* scratch) const = 0; private: /// No copying allowed @@ -189,8 +189,7 @@ class EnvWrapper : public Env { Env* target() const { return target_; } // The following text is boilerplate that forwards all methods to target() - Status NewRandomAccessFile(const string& f, - RandomAccessFile** r) override { + Status NewRandomAccessFile(const string& f, RandomAccessFile** r) override { return target_->NewRandomAccessFile(f, r); } Status NewWritableFile(const string& f, WritableFile** r) override { @@ -203,15 +202,9 @@ class EnvWrapper : public Env { Status GetChildren(const string& dir, std::vector* r) override { return target_->GetChildren(dir, r); } - Status DeleteFile(const string& f) override { - return target_->DeleteFile(f); - } - Status CreateDir(const string& d) override { - return target_->CreateDir(d); - } - Status DeleteDir(const string& d) override { - return target_->DeleteDir(d); - } + Status DeleteFile(const string& f) override { return target_->DeleteFile(f); } + Status CreateDir(const string& d) override { return target_->CreateDir(d); } + Status DeleteDir(const string& d) override { return target_->DeleteDir(d); } Status GetFileSize(const string& f, uint64* s) override { return target_->GetFileSize(f, s); } @@ -261,7 +254,7 @@ Status ReadFileToString(Env* env, const string& fname, string* data); /// A utility routine: write contents of "data" to file named "fname" /// (overwriting existing contents, if any). Status WriteStringToFile(Env* env, const string& fname, - const StringPiece& data); + const StringPiece& data); /// Reads contents of named file and parse as binary encoded proto data /// and store into *proto. diff --git a/tensorflow/core/public/tensor.h b/tensorflow/core/public/tensor.h index bcb556345aa..e80d101ea12 100644 --- a/tensorflow/core/public/tensor.h +++ b/tensorflow/core/public/tensor.h @@ -1,6 +1,7 @@ #ifndef TENSORFLOW_PUBLIC_TENSOR_H_ #define TENSORFLOW_PUBLIC_TENSOR_H_ +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/allocation_description.pb.h" #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/tensor.pb.h" @@ -8,13 +9,12 @@ #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" +#include "tensorflow/core/lib/core/refcount.h" +#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor_shape.h" -#include "tensorflow/core/lib/core/refcount.h" -#include "tensorflow/core/lib/core/stringpiece.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { diff --git a/tensorflow/core/public/tensor_shape.h b/tensorflow/core/public/tensor_shape.h index 1837a379448..5aa23078c9b 100644 --- a/tensorflow/core/public/tensor_shape.h +++ b/tensorflow/core/public/tensor_shape.h @@ -3,13 +3,13 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/tensor_shape.pb.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/array_slice.h" #include "tensorflow/core/lib/gtl/inlined_vector.h" #include "tensorflow/core/lib/strings/strcat.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/platform/logging.h" namespace tensorflow { diff --git a/tensorflow/core/util/bcast_test.cc b/tensorflow/core/util/bcast_test.cc index 02d18586d6b..6c7e2202646 100644 --- a/tensorflow/core/util/bcast_test.cc +++ b/tensorflow/core/util/bcast_test.cc @@ -1,8 +1,8 @@ #include "tensorflow/core/util/bcast.h" -#include "tensorflow/core/lib/strings/strcat.h" -#include "tensorflow/core/lib/strings/str_util.h" #include +#include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/lib/strings/strcat.h" namespace tensorflow { namespace { diff --git a/tensorflow/core/util/device_name_utils_test.cc b/tensorflow/core/util/device_name_utils_test.cc index 14f30d6de5c..542c8851ad8 100644 --- a/tensorflow/core/util/device_name_utils_test.cc +++ b/tensorflow/core/util/device_name_utils_test.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/util/device_name_utils.h" +#include #include "tensorflow/core/lib/core/errors.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { diff --git a/tensorflow/core/util/padding.cc b/tensorflow/core/util/padding.cc index 24273e5ca43..875e7486294 100644 --- a/tensorflow/core/util/padding.cc +++ b/tensorflow/core/util/padding.cc @@ -6,7 +6,7 @@ namespace tensorflow { Status GetNodeAttr(const NodeDef& node_def, const string& attr_name, - Padding* value) { + Padding* value) { string str_value; TF_RETURN_IF_ERROR(GetNodeAttr(node_def, attr_name, &str_value)); if (str_value == "SAME") { diff --git a/tensorflow/core/util/padding.h b/tensorflow/core/util/padding.h index 66cd96abdb1..997b3b2bfcd 100644 --- a/tensorflow/core/util/padding.h +++ b/tensorflow/core/util/padding.h @@ -30,7 +30,7 @@ string GetPaddingAttrString(); // Specialization to parse an attribute directly into a Padding enum. Status GetNodeAttr(const NodeDef& node_def, const string& attr_name, - Padding* value); + Padding* value); } // end namespace tensorflow diff --git a/tensorflow/core/util/saved_tensor_slice_util.h b/tensorflow/core/util/saved_tensor_slice_util.h index 6206cd85389..fae54d2c9b1 100644 --- a/tensorflow/core/util/saved_tensor_slice_util.h +++ b/tensorflow/core/util/saved_tensor_slice_util.h @@ -4,10 +4,10 @@ #define TENSORFLOW_UTIL_SAVED_TENSOR_SLICE_UTIL_H_ #include // for string -#include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/framework/tensor.pb.h" #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/framework/types.h" +#include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/public/status.h" // for Status namespace tensorflow { diff --git a/tensorflow/core/util/sparse/dim_comparator.h b/tensorflow/core/util/sparse/dim_comparator.h index 57473867cf7..20438b2b851 100644 --- a/tensorflow/core/util/sparse/dim_comparator.h +++ b/tensorflow/core/util/sparse/dim_comparator.h @@ -1,9 +1,9 @@ #ifndef TENSORFLOW_UTIL_SPARSE_DIM_COMPARATOR_H_ #define TENSORFLOW_UTIL_SPARSE_DIM_COMPARATOR_H_ -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/platform/logging.h" #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { namespace sparse { diff --git a/tensorflow/core/util/sparse/group_iterator.h b/tensorflow/core/util/sparse/group_iterator.h index 8423d54f27d..26e6b3aa0d4 100644 --- a/tensorflow/core/util/sparse/group_iterator.h +++ b/tensorflow/core/util/sparse/group_iterator.h @@ -1,11 +1,11 @@ #ifndef TENSORFLOW_UTIL_SPARSE_GROUP_ITERATOR_H_ #define TENSORFLOW_UTIL_SPARSE_GROUP_ITERATOR_H_ -#include "tensorflow/core/platform/port.h" +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace sparse { diff --git a/tensorflow/core/util/sparse/sparse_tensor.h b/tensorflow/core/util/sparse/sparse_tensor.h index dcb75e7f54e..65e6282c070 100644 --- a/tensorflow/core/util/sparse/sparse_tensor.h +++ b/tensorflow/core/util/sparse/sparse_tensor.h @@ -3,17 +3,17 @@ #include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/tensor_types.h" -#include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/platform/port.h" -#include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/status.h" +#include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/lib/strings/str_util.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/port.h" +#include "tensorflow/core/public/status.h" #include "tensorflow/core/public/tensor.h" #include "tensorflow/core/util/sparse/dim_comparator.h" #include "tensorflow/core/util/sparse/group_iterator.h" -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace sparse { diff --git a/tensorflow/core/util/sparse/sparse_tensor_test.cc b/tensorflow/core/util/sparse/sparse_tensor_test.cc index 47126b71872..5e219a2c62b 100644 --- a/tensorflow/core/util/sparse/sparse_tensor_test.cc +++ b/tensorflow/core/util/sparse/sparse_tensor_test.cc @@ -3,11 +3,11 @@ #include #include +#include +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/tensor_types.h" #include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/public/tensor.h" -#include -#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace sparse { diff --git a/tensorflow/core/util/tensor_slice_reader_cache.h b/tensorflow/core/util/tensor_slice_reader_cache.h index eaeeeec83fb..ab6f10a9257 100644 --- a/tensorflow/core/util/tensor_slice_reader_cache.h +++ b/tensorflow/core/util/tensor_slice_reader_cache.h @@ -8,8 +8,8 @@ #include #include "tensorflow/core/platform/port.h" -#include "tensorflow/core/util/tensor_slice_reader.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/util/tensor_slice_reader.h" namespace tensorflow { diff --git a/tensorflow/core/util/tensor_slice_reader_test.cc b/tensorflow/core/util/tensor_slice_reader_test.cc index e14b9200037..5b6ad47d657 100644 --- a/tensorflow/core/util/tensor_slice_reader_test.cc +++ b/tensorflow/core/util/tensor_slice_reader_test.cc @@ -1,5 +1,6 @@ #include "tensorflow/core/util/tensor_slice_reader.h" +#include #include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/core/stringpiece.h" @@ -10,9 +11,8 @@ #include "tensorflow/core/platform/protobuf.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/util/saved_tensor_slice_util.h" -#include "tensorflow/core/util/tensor_slice_writer.h" #include "tensorflow/core/util/tensor_slice_reader_cache.h" -#include +#include "tensorflow/core/util/tensor_slice_writer.h" namespace tensorflow { diff --git a/tensorflow/core/util/tensor_slice_set.cc b/tensorflow/core/util/tensor_slice_set.cc index 765686f189f..7721cd88d09 100644 --- a/tensorflow/core/util/tensor_slice_set.cc +++ b/tensorflow/core/util/tensor_slice_set.cc @@ -1,9 +1,9 @@ #include "tensorflow/core/util/tensor_slice_set.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/util/tensor_slice_util.h" #include "tensorflow/core/lib/gtl/map_util.h" +#include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/util/tensor_slice_util.h" namespace tensorflow { @@ -14,8 +14,8 @@ TensorSliceSet::TensorSliceSet(const TensorShape& shape, DataType type) TensorSliceSet::~TensorSliceSet() {} -Status TensorSliceSet::Register(const TensorSlice& slice, - const string& tag, const float* data) { +Status TensorSliceSet::Register(const TensorSlice& slice, const string& tag, + const float* data) { TensorShape result_shape; TF_RETURN_IF_ERROR(slice.SliceTensorShape(shape_, &result_shape)); string str = slice.DebugString(); diff --git a/tensorflow/core/util/tensor_slice_set.h b/tensorflow/core/util/tensor_slice_set.h index f3f7ac0e76d..0156eb1bb61 100644 --- a/tensorflow/core/util/tensor_slice_set.h +++ b/tensorflow/core/util/tensor_slice_set.h @@ -7,15 +7,15 @@ #ifndef TENSORFLOW_UTIL_TENSOR_SLICE_SET_H_ #define TENSORFLOW_UTIL_TENSOR_SLICE_SET_H_ -#include // for string +#include // for string #include -#include "tensorflow/core/platform/port.h" // for int64 #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/lib/core/stringpiece.h" // for StringPiece +#include "tensorflow/core/platform/port.h" // for int64 #include "tensorflow/core/public/status.h" // for Status +#include "tensorflow/core/public/tensor_shape.h" namespace tensorflow { @@ -37,7 +37,7 @@ class TensorSliceSet { // the data is always available during the life time of the tensor slice set // if it is not nullptr. Status Register(const TensorSlice& slice, const string& tag, - const float* data); + const float* data); // Query about a new slice: checks if we have data for "slice" and if we have // the data and "data" is not nullptr, fill "data" with the slice data. The diff --git a/tensorflow/core/util/tensor_slice_set_test.cc b/tensorflow/core/util/tensor_slice_set_test.cc index fb2f46f34c4..90c5b9fe30a 100644 --- a/tensorflow/core/util/tensor_slice_set_test.cc +++ b/tensorflow/core/util/tensor_slice_set_test.cc @@ -1,7 +1,7 @@ #include "tensorflow/core/util/tensor_slice_set.h" -#include "tensorflow/core/platform/logging.h" #include +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/status.h" namespace tensorflow { diff --git a/tensorflow/core/util/tensor_slice_writer.cc b/tensorflow/core/util/tensor_slice_writer.cc index bb2fd96c052..1b5629bc6b4 100644 --- a/tensorflow/core/util/tensor_slice_writer.cc +++ b/tensorflow/core/util/tensor_slice_writer.cc @@ -1,10 +1,10 @@ #include "tensorflow/core/util/tensor_slice_writer.h" #include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/lib/io/table_builder.h" #include "tensorflow/core/lib/random/random.h" #include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/public/env.h" #include "tensorflow/core/util/saved_tensor_slice_util.h" @@ -48,8 +48,8 @@ class TableBuilder : public TensorSliceWriter::Builder { }; } // anonymous namespace -Status CreateTableTensorSliceBuilder( - const string& name, TensorSliceWriter::Builder** builder) { +Status CreateTableTensorSliceBuilder(const string& name, + TensorSliceWriter::Builder** builder) { *builder = nullptr; WritableFile* f; Status s = Env::Default()->NewWritableFile(name, &f); diff --git a/tensorflow/core/util/tensor_slice_writer.h b/tensorflow/core/util/tensor_slice_writer.h index cce3880cb3c..5ede03d75c7 100644 --- a/tensorflow/core/util/tensor_slice_writer.h +++ b/tensorflow/core/util/tensor_slice_writer.h @@ -10,12 +10,12 @@ #include "tensorflow/core/framework/tensor_slice.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/platform/logging.h" -#include "tensorflow/core/public/tensor_shape.h" +#include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/status.h" +#include "tensorflow/core/public/tensor_shape.h" #include "tensorflow/core/util/saved_tensor_slice.pb.h" #include "tensorflow/core/util/saved_tensor_slice_util.h" @@ -32,8 +32,7 @@ class TensorSliceWriter { virtual void Add(StringPiece key, StringPiece value) = 0; virtual Status Finish(int64* file_size) = 0; }; - typedef std::function - CreateBuilderFunction; + typedef std::function CreateBuilderFunction; TensorSliceWriter(const string& filename, CreateBuilderFunction create_builder); @@ -42,7 +41,7 @@ class TensorSliceWriter { // TODO(yangke): add more supports template Status Add(const string& name, const TensorShape& shape, - const TensorSlice& slice, const T* data); + const TensorSlice& slice, const T* data); Status Finish(); private: @@ -68,7 +67,7 @@ class TensorSliceWriter { template Status TensorSliceWriter::Add(const string& name, const TensorShape& shape, - const TensorSlice& slice, const T* data) { + const TensorSlice& slice, const T* data) { // The tensor and the slice have to be compatible if (shape.dims() != slice.dims()) { return errors::Internal("Incompatible tensor shape and slice: ", "shape = ", @@ -140,7 +139,7 @@ void TensorSliceWriter::SaveData(const T* data, int num_elements, // and set "*builder" to the allocated builder. Otherwise, return a // non-OK status. Status CreateTableTensorSliceBuilder(const string& filename, - TensorSliceWriter::Builder** builder); + TensorSliceWriter::Builder** builder); } // namespace checkpoint diff --git a/tensorflow/core/util/tensor_slice_writer_test.cc b/tensorflow/core/util/tensor_slice_writer_test.cc index ca3dffe422b..3f28aff1509 100644 --- a/tensorflow/core/util/tensor_slice_writer_test.cc +++ b/tensorflow/core/util/tensor_slice_writer_test.cc @@ -1,13 +1,13 @@ #include "tensorflow/core/util/tensor_slice_writer.h" -#include "tensorflow/core/platform/logging.h" +#include +#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/io/path.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/platform/test.h" #include "tensorflow/core/util/saved_tensor_slice_util.h" #include "tensorflow/core/util/tensor_slice_reader.h" -#include "tensorflow/core/lib/core/stringpiece.h" -#include "tensorflow/core/platform/test.h" -#include namespace tensorflow { @@ -42,7 +42,7 @@ void ExpectIdenticalIntArrays(const T* expected, int size, const U* actual) { // Nifty routine to get the size of an array template -inline size_t ArraySize(const T(&v)[SIZE]) { +inline size_t ArraySize(const T (&v)[SIZE]) { return SIZE; } diff --git a/tensorflow/core/util/work_sharder.h b/tensorflow/core/util/work_sharder.h index 1ea2cf4397e..b968d9faedc 100644 --- a/tensorflow/core/util/work_sharder.h +++ b/tensorflow/core/util/work_sharder.h @@ -3,8 +3,8 @@ #include -#include "tensorflow/core/platform/port.h" #include "tensorflow/core/lib/core/threadpool.h" +#include "tensorflow/core/platform/port.h" namespace tensorflow { diff --git a/tensorflow/core/util/work_sharder_test.cc b/tensorflow/core/util/work_sharder_test.cc index d9792c0e8d5..c821f40f9bb 100644 --- a/tensorflow/core/util/work_sharder_test.cc +++ b/tensorflow/core/util/work_sharder_test.cc @@ -1,10 +1,10 @@ #include "tensorflow/core/util/work_sharder.h" -#include "tensorflow/core/platform/logging.h" +#include #include "tensorflow/core/lib/core/threadpool.h" +#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/platform/test_benchmark.h" -#include namespace tensorflow { namespace { diff --git a/tensorflow/g3doc/tutorials/mnist/mnist.py b/tensorflow/g3doc/tutorials/mnist/mnist.py index 925debac6ef..35216737618 100644 --- a/tensorflow/g3doc/tutorials/mnist/mnist.py +++ b/tensorflow/g3doc/tutorials/mnist/mnist.py @@ -91,7 +91,7 @@ def loss(logits, labels): # be a 1.0 in the entry corresponding to the label). batch_size = tf.size(labels) labels = tf.expand_dims(labels, 1) - indices = tf.expand_dims(tf.range(batch_size), 1) + indices = tf.expand_dims(tf.range(0, batch_size), 1) concated = tf.concat(1, [indices, labels]) onehot_labels = tf.sparse_to_dense( concated, tf.pack([batch_size, NUM_CLASSES]), 1.0, 0.0) diff --git a/tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py b/tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py index d7acb3960ef..3a8b7c1cb76 100644 --- a/tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py +++ b/tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py @@ -1,5 +1,4 @@ from __future__ import absolute_import -from __future__ import division from __future__ import print_function import tensorflow.python.platform diff --git a/tensorflow/models/image/alexnet/alexnet_benchmark.py b/tensorflow/models/image/alexnet/alexnet_benchmark.py index 740524fd0b2..0073fb15596 100644 --- a/tensorflow/models/image/alexnet/alexnet_benchmark.py +++ b/tensorflow/models/image/alexnet/alexnet_benchmark.py @@ -58,7 +58,7 @@ def inference(images): conv = tf.nn.conv2d(images, kernel, [1, 4, 4, 1], padding='VALID') biases = tf.Variable(tf.constant(0.0, shape=[64], dtype=tf.float32), trainable=True, name='biases') - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape()) + bias = tf.nn.bias_add(conv, biases) conv1 = tf.nn.relu(bias, name=scope) print_activations(conv1) parameters += [kernel, biases] @@ -81,7 +81,7 @@ def inference(images): conv = tf.nn.conv2d(pool1, kernel, [1, 1, 1, 1], padding='SAME') biases = tf.Variable(tf.constant(0.0, shape=[192], dtype=tf.float32), trainable=True, name='biases') - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape()) + bias = tf.nn.bias_add(conv, biases) conv2 = tf.nn.relu(bias, name=scope) parameters += [kernel, biases] print_activations(conv2) @@ -102,7 +102,7 @@ def inference(images): conv = tf.nn.conv2d(pool2, kernel, [1, 1, 1, 1], padding='SAME') biases = tf.Variable(tf.constant(0.0, shape=[384], dtype=tf.float32), trainable=True, name='biases') - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape()) + bias = tf.nn.bias_add(conv, biases) conv3 = tf.nn.relu(bias, name=scope) parameters += [kernel, biases] print_activations(conv3) @@ -115,7 +115,7 @@ def inference(images): conv = tf.nn.conv2d(conv3, kernel, [1, 1, 1, 1], padding='SAME') biases = tf.Variable(tf.constant(0.0, shape=[256], dtype=tf.float32), trainable=True, name='biases') - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape()) + bias = tf.nn.bias_add(conv, biases) conv4 = tf.nn.relu(bias, name=scope) parameters += [kernel, biases] print_activations(conv4) @@ -128,7 +128,7 @@ def inference(images): conv = tf.nn.conv2d(conv4, kernel, [1, 1, 1, 1], padding='SAME') biases = tf.Variable(tf.constant(0.0, shape=[256], dtype=tf.float32), trainable=True, name='biases') - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape()) + bias = tf.nn.bias_add(conv, biases) conv5 = tf.nn.relu(bias, name=scope) parameters += [kernel, biases] print_activations(conv5) diff --git a/tensorflow/models/image/cifar10/cifar10.py b/tensorflow/models/image/cifar10/cifar10.py index 627cf01b6a2..cbec8fb6d1a 100644 --- a/tensorflow/models/image/cifar10/cifar10.py +++ b/tensorflow/models/image/cifar10/cifar10.py @@ -289,7 +289,7 @@ def inference(images): stddev=1e-4, wd=0.0) conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME') biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0)) - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape().as_list()) + bias = tf.nn.bias_add(conv, biases) conv1 = tf.nn.relu(bias, name=scope.name) _activation_summary(conv1) @@ -306,7 +306,7 @@ def inference(images): stddev=1e-4, wd=0.0) conv = tf.nn.conv2d(norm1, kernel, [1, 1, 1, 1], padding='SAME') biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.1)) - bias = tf.reshape(tf.nn.bias_add(conv, biases), conv.get_shape().as_list()) + bias = tf.nn.bias_add(conv, biases) conv2 = tf.nn.relu(bias, name=scope.name) _activation_summary(conv2) diff --git a/tensorflow/tensorboard/tensorboard.py b/tensorflow/tensorboard/tensorboard.py index e1a09655f24..814689e7ccf 100644 --- a/tensorflow/tensorboard/tensorboard.py +++ b/tensorflow/tensorboard/tensorboard.py @@ -42,9 +42,8 @@ tensorboard --logdir=name1:/path/to/logs/1,name2:/path/to/logs/2 """) flags.DEFINE_boolean('debug', False, 'Whether to run the app in debug mode. ' 'This increases log verbosity to DEBUG.') -flags.DEFINE_string('host', '0.0.0.0', 'What host to listen to. Defaults to ' - 'allowing remote access, set to 127.0.0.1 to serve only on ' - 'localhost.') +flags.DEFINE_string('host', '127.0.0.1', 'What host to listen to. Defaults to ' + 'serving on localhost, set to 0.0.0.0 for remote access.') flags.DEFINE_integer('port', 6006, 'What port to serve TensorBoard on.') FLAGS = flags.FLAGS