Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for mock (0.15 sec)

  1. tensorflow/c/c_api.cc

    bool ExtendSessionGraphHelper(TF_Session* session, TF_Status* status) {
      if (session->graph != nullptr) {
        // Take the graph lock before the session lock to avoid deadlock. This is
        // safe since session->graph does not change.
        session->graph->mu.lock();
        mutex_lock session_lock(session->mu);
        const Graph& graph = session->graph->graph;
    
        const string& mutation_warning = session->graph->sessions[session];
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 102.3K bytes
    - Viewed (0)
  2. tensorflow/c/env_test.cc

    namespace {
    
    struct SomeThreadData {
      ::tensorflow::mutex mu;
      bool did_work = false;
    };
    
    void SomeThreadFunc(void* data) {
      auto* real_data = static_cast<SomeThreadData*>(data);
      ::tensorflow::mutex_lock l(real_data->mu);
      real_data->did_work = true;
    }
    
    }  // namespace
    
    TEST(TestEnv, TestThreads) {
      TF_ThreadOptions options;
      TF_DefaultThreadOptions(&options);
      SomeThreadData data;
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Dec 10 20:52:48 GMT 2018
    - 4.2K bytes
    - Viewed (0)
  3. tensorflow/c/c_api_experimental.cc

      static std::unordered_map<std::string, void*>* loaded_libs =
          new std::unordered_map<std::string, void*>();
      tensorflow::Env* env = tensorflow::Env::Default();
      {
        tensorflow::mutex_lock lock(mu);
        auto it = loaded_libs->find(library_filename);
        if (it != loaded_libs->end()) {
          lib_handle->lib_handle = it->second;
        } else {
          status->status =
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 29.4K bytes
    - Viewed (0)
  4. tensorflow/c/eager/parallel_device/parallel_device_lib.cc

      std::unique_ptr<Thread> thread_;
    };
    
    DeviceThread::~DeviceThread() {
      {
        tensorflow::mutex_lock l(execution_mutex_);
        execution_state_ = ExecutionState::kShuttingDown;
      }
      start_execute_.notify_one();
    }
    
    void DeviceThread::AsyncWait(TF_Status* status) {
      tensorflow::mutex_lock l(execution_mutex_);
      TFE_ExecutorWaitForAllPendingNodes(executor_.get(), status);
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Feb 09 07:47:20 GMT 2024
    - 25.4K bytes
    - Viewed (1)
  5. tensorflow/c/c_api_function.cc

    }
    
    int TF_GraphNumFunctions(TF_Graph* g) {
      tensorflow::mutex_lock l(g->mu);
      return g->graph.flib_def().num_functions();
    }
    
    int TF_GraphGetFunctions(TF_Graph* g, TF_Function** funcs, int max_func,
                             TF_Status* status) {
      tensorflow::FunctionDefLibrary lib;
      {
        tensorflow::mutex_lock l(g->mu);
        lib = g->graph.flib_def().ToProto();
      }
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 13.6K bytes
    - Viewed (2)
  6. tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache.cc

            block->mu.Unlock();  // Release the lock while making the API call.
            block->data.clear();
            block->data.resize(block_size_, 0);
            int64_t bytes_transferred;
            bytes_transferred = block_fetcher_(key.first, key.second, block_size_,
                                               block->data.data(), status);
            block->mu.Lock();  // Reacquire the lock immediately afterwards
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Jul 16 01:39:09 GMT 2020
    - 11.1K bytes
    - Viewed (0)
  7. tensorflow/c/c_api_test.cc

      int counter_;
    };
    
    // Helper macros for the TF_OperationGetAttr* tests.
    // TODO(ashankar): Use gmock matchers instead?
    // (https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#writing-new-parameterized-matchers-quickly)
    // That will require setting up the tensorflow build with gmock.
    #define EXPECT_TF_META(attr_name, expected_list_size, expected_type, \
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 96.9K bytes
    - Viewed (3)
  8. tensorflow/c/experimental/filesystem/plugins/gcs/gcs_filesystem.cc

    // https://github.com/googleapis/google-cloud-cpp/issues/4482 is done.
    GCSFile::GCSFile(google::cloud::storage::Client&& gcs_client)
        : gcs_client(gcs_client), block_cache_lock() {
      const char* append_mode = std::getenv(kAppendMode);
      compose = (append_mode != nullptr) && (!strcmp(kAppendMode, append_mode));
    
      uint64_t value;
      block_size = kDefaultBlockSize;
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Wed Aug 23 06:55:53 GMT 2023
    - 46.9K bytes
    - Viewed (0)
  9. tensorflow/c/eager/c_api_unified_experimental_graph.cc

        TF_RETURN_IF_ERROR(tensorflow::TensorShapeUtils::MakeShape(dims, shape));
    
        return absl::OkStatus();
      }
    
      tensorflow::FullTypeDef FullType() const override {
        const FullTypeDef* ft;
        mutex_lock l(graph_->mu);
        graph_->graph.NodeType(output_.oper->node.name(), &ft);
        if (ft == nullptr) {
          return FullTypeDef();
        } else {
          return *ft;
        }
      }
    
      TF_Output output_;
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Tue Mar 12 20:00:09 GMT 2024
    - 15.4K bytes
    - Viewed (1)
  10. tensorflow/c/c_api_function_test.cc

      ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_);
    
      TF_DeleteFunction(grad_func);
    
      const StackTracesMap* func_stack_traces;
      const StackTracesMap* grad_stack_traces;
    
      {
        mutex_lock l(host_graph_->mu);
        auto flib_def = host_graph_->graph.flib_def();
        func_stack_traces = flib_def.GetStackTraces(func_name_);
        grad_stack_traces = flib_def.GetStackTraces("MyGrad");
      }
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Jul 20 22:08:54 GMT 2023
    - 63.6K bytes
    - Viewed (6)
Back to top