diff options
author | Derek Murray <mrry@google.com> | 2018-09-27 11:01:56 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-27 11:07:13 -0700 |
commit | dcf72802384fdab6744d3c16577091a82bc2cce0 (patch) | |
tree | 9db4a1d1bccf5236c1f114358b904d8827d4e9b5 /tensorflow/core/common_runtime | |
parent | 6d41787c32483b28f8c93973f28d4d078ea0b37e (diff) |
Clean up unused members in DirectSession and Executor.
PiperOrigin-RevId: 214802032
Diffstat (limited to 'tensorflow/core/common_runtime')
-rw-r--r-- | tensorflow/core/common_runtime/direct_session.cc | 8 | ||||
-rw-r--r-- | tensorflow/core/common_runtime/direct_session.h | 20 | ||||
-rw-r--r-- | tensorflow/core/common_runtime/executor.h | 6 |
3 files changed, 12 insertions, 22 deletions
diff --git a/tensorflow/core/common_runtime/direct_session.cc b/tensorflow/core/common_runtime/direct_session.cc index af5d5b17e7..841181f8c3 100644 --- a/tensorflow/core/common_runtime/direct_session.cc +++ b/tensorflow/core/common_runtime/direct_session.cc @@ -363,7 +363,7 @@ Status DirectSession::MaybeInitializeExecutionState( Status DirectSession::Create(const GraphDef& graph) { TF_RETURN_IF_ERROR(init_error_); if (graph.node_size() > 0) { - mutex_lock l(graph_def_lock_); + mutex_lock l(graph_state_lock_); if (graph_created_) { return errors::AlreadyExists( "A Graph has already been created for this session."); @@ -375,7 +375,7 @@ Status DirectSession::Create(const GraphDef& graph) { Status DirectSession::Extend(const GraphDef& graph) { TF_RETURN_IF_ERROR(CheckNotClosed()); - mutex_lock l(graph_def_lock_); + mutex_lock l(graph_state_lock_); return ExtendLocked(graph); } @@ -1172,7 +1172,7 @@ Status DirectSession::CreateExecutors( int graph_def_version; { - mutex_lock l(graph_def_lock_); + mutex_lock l(graph_state_lock_); graph_def_version = execution_state_->original_graph_def().versions().producer(); } @@ -1400,7 +1400,7 @@ Status DirectSession::CreateGraphs( std::unique_ptr<FunctionLibraryDefinition>* flib_def, RunStateArgs* run_state_args, DataTypeVector* input_types, DataTypeVector* output_types, int64* collective_graph_key) { - mutex_lock l(graph_def_lock_); + mutex_lock l(graph_state_lock_); std::unique_ptr<ClientGraph> client_graph; std::unique_ptr<GraphExecutionState> temp_exec_state_holder; diff --git a/tensorflow/core/common_runtime/direct_session.h b/tensorflow/core/common_runtime/direct_session.h index c2cf3c7fd7..4a6a921ea7 100644 --- a/tensorflow/core/common_runtime/direct_session.h +++ b/tensorflow/core/common_runtime/direct_session.h @@ -215,7 +215,7 @@ class DirectSession : public Session { // if not already initialized. Status MaybeInitializeExecutionState(const GraphDef& graph, bool* out_already_initialized) - EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_); + EXCLUSIVE_LOCKS_REQUIRED(graph_state_lock_); // Retrieves an already existing set of executors to run 'inputs' and // 'outputs', or creates and caches them for future use. @@ -248,7 +248,7 @@ class DirectSession : public Session { RunMetadata* run_metadata); ::tensorflow::Status ExtendLocked(const GraphDef& graph) - EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_); + EXCLUSIVE_LOCKS_REQUIRED(graph_state_lock_); ::tensorflow::Status ResourceHandleToInputTensor( const Tensor& resource_tensor, Tensor* retrieved_tensor); @@ -289,7 +289,7 @@ class DirectSession : public Session { } ::tensorflow::Status CheckGraphCreated(const char* method) { - mutex_lock l(graph_def_lock_); + mutex_lock l(graph_state_lock_); if (!graph_created_) { return errors::InvalidArgument( "Session was not created with a graph before ", method, "!"); @@ -313,10 +313,8 @@ class DirectSession : public Session { DeviceSet device_set_; string session_handle_; - bool graph_created_ GUARDED_BY(graph_def_lock_) = false; - - mutex graph_def_lock_; - GraphDef graph_def_ GUARDED_BY(graph_def_lock_); + mutex graph_state_lock_; + bool graph_created_ GUARDED_BY(graph_state_lock_) = false; // The thread-pools to use for running ops, with a bool indicating if the pool // is owned. @@ -367,11 +365,11 @@ class DirectSession : public Session { // nodes can not be moved to a different device. Maps node names to // device names. std::unordered_map<string, string> stateful_placements_ - GUARDED_BY(graph_def_lock_); + GUARDED_BY(graph_state_lock_); // Execution_state; used when placing the entire graph. std::unique_ptr<GraphExecutionState> execution_state_ - GUARDED_BY(graph_def_lock_); + GUARDED_BY(graph_state_lock_); // The function library, before any rewrites or optimizations have been // performed. In particular, CreateGraphs() may need to modify the function @@ -386,7 +384,7 @@ class DirectSession : public Session { std::atomic<int64> edge_name_counter_ = {0}; std::atomic<int64> handle_name_counter_ = {0}; - // For generating step ids that are unique across all sessions. + // For generating step ids that are unique across this sessions. static std::atomic_int_fast64_t step_id_counter_; // Global timeout for all blocking operations in this session. @@ -395,8 +393,6 @@ class DirectSession : public Session { // Manages all the cost models for the graphs executed in this session. CostModelManager cost_model_manager_; - Executor::Args::NodeOutputsCallback node_outputs_callback_ = nullptr; - // For testing collective graph key generation. mutex collective_graph_key_lock_; int64 collective_graph_key_ GUARDED_BY(collective_graph_key_lock_) = -1; diff --git a/tensorflow/core/common_runtime/executor.h b/tensorflow/core/common_runtime/executor.h index 6cd4fd22ea..34bf73972f 100644 --- a/tensorflow/core/common_runtime/executor.h +++ b/tensorflow/core/common_runtime/executor.h @@ -97,12 +97,6 @@ class Executor { typedef std::function<void()> Closure; typedef std::function<void(Closure)> Runner; Runner runner = nullptr; - - // A callback that is invoked each time a node has finished executing. - typedef std::function<Status(const string& node_name, const int output_slot, - const Tensor* tensor, const bool is_ref, - OpKernelContext* ctx)> - NodeOutputsCallback; }; typedef std::function<void(const Status&)> DoneCallback; virtual void RunAsync(const Args& args, DoneCallback done) = 0; |