Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for element (0.22 sec)

  1. tensorflow/c/c_api.cc

      shapes.resize(num_shapes);
      for (int i = 0; i < num_shapes; ++i) {
        if (proto_lens[i] > std::numeric_limits<int>::max()) {
          status->status = InvalidArgument(
              "length of element ", i, " in the list (", proto_lens[i],
              " bytes) is too large to be parsed by the protocol buffer library");
          return;
        }
        if (!shapes[i].ParseFromArray(protos[i], static_cast<int>(proto_lens[i]))) {
    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/eager/dlpack_test.cc

                              std::vector<int64_t> shape,
                              std::vector<int64_t> strides) {
      size_t num_elements = 1;
      for (int i = 0; i < static_cast<int32_t>(shape.size()); ++i) {
        num_elements *= shape[i];
      }
      std::vector<float> data(num_elements);
      for (size_t j = 0; j < num_elements; ++j) {
        data[j] = j;
      }
      DLManagedTensor dlm_in = {};
      DLTensor* dltensor_in = &dlm_in.dl_tensor;
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Jun 30 03:04:46 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  3. tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc

      TF_EXPECT_OK(ReadCache(&cache, "", 2 * block_size, 1, &out));
      // Element at block_size was evicted.  Reading this element will also cause
      // the LRU element (at 0) to be evicted.
      calls.push_back(block_size);
      TF_EXPECT_OK(ReadCache(&cache, "", block_size, 1, &out));
      // Element at 0 was evicted again.
      calls.push_back(0);
      TF_EXPECT_OK(ReadCache(&cache, "", 0, 1, &out));
    }
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Fri Oct 15 03:16:57 GMT 2021
    - 23.2K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/filesystem/plugins/gcs/expiring_lru_cache_test.cc

      std::unique_ptr<NowSecondsEnv> env(new NowSecondsEnv);
      tf_gcs_filesystem::ExpiringLRUCache<int> cache(
          1, 0, [&env]() { return env->NowSeconds(); });
      env->SetNowSeconds(1);
      // Verify that replacement of an existing element works, and updates the
      // timestamp of the entry.
      cache.Insert(key, 41);
      env->SetNowSeconds(2);
      cache.Insert(key, 42);
      // 1 second after the most recent insertion, the entry is still valid.
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Jul 09 19:31:22 GMT 2020
    - 7.1K bytes
    - Viewed (0)
  5. tensorflow/c/c_api_experimental.cc

      std::vector<Tensor> all_input_tensors;
      // Update the vector with information from `input_tensors` if provided.
      if (input_tensors != nullptr) {
        // Note that we take the address of the elements in `all_input_tensors`
        // below. Allocate enough space so that no reallocation happens, which will
        // make the pointers invalid.
        all_input_tensors.reserve(num_inputs);
        for (int i = 0; i < num_inputs; ++i) {
    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)
  6. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util_test.cc

      std::vector<int32_t> data(1, 0);
      xla::Shape shape = xla::ShapeUtil::MakeShape(xla::S32, {1});
    
      auto buffer = c_api_client->pjrt_c_client()->client->BufferFromHostBuffer(
          data.data(), shape.element_type(), shape.dimensions(),
          /*byte_strides=*/std::nullopt,
          xla::PjRtClient::HostBufferSemantics::kImmutableOnlyDuringCall, nullptr,
          c_api_client->pjrt_c_client()->client->addressable_devices()[0]);
    C++
    - Registered: Tue Feb 27 12:39:08 GMT 2024
    - Last Modified: Mon Oct 30 19:20:20 GMT 2023
    - 7.2K bytes
    - Viewed (0)
  7. tensorflow/c/c_api_test.cc

      const int num_dims = 2;
      int64_t* dims = new int64_t[num_dims];
      int64_t num_elements = 1;
      dims[0] = batch_size;
      dims[1] = 1;
      for (int64_t i = 0; i < num_dims; ++i) {
        num_elements *= dims[i];
      }
      TF_Tensor* t = TF_AllocateTensor(TF_STRING, dims, num_dims,
                                       sizeof(TF_TString) * num_elements);
      delete[] dims;
    
    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/eager/gradients.cc

    class TapeVSpace
        : public eager::VSpace<AbstractTensorHandle, GradientFunction, TapeTensor> {
     public:
      explicit TapeVSpace(AbstractContext* ctx) : ctx_(ctx) {}
      ~TapeVSpace() override {}
    
      // Returns the number of elements in the gradient tensor.
      int64_t NumElements(AbstractTensorHandle* tensor) const override;
    
      // Consumes references to the tensors in the gradient_tensors list and returns
      // a tensor with the result.
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 19.3K bytes
    - Viewed (0)
  9. tensorflow/c/eager/gradient_checker.cc

      // Convert from AbstractTensor to TF_Tensor.
      TF_Tensor* theta_tensor;
      TF_RETURN_IF_ERROR(GetValue(theta, &theta_tensor));
    
      // Get number of elements and fill data.
      int num_elems = TF_TensorElementCount(theta_tensor);
      vector<float> theta_data(num_elems);
      memcpy(theta_data.data(), TF_TensorData(theta_tensor),
             TF_TensorByteSize(theta_tensor));
    
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  10. tensorflow/c/eager/c_api_test_util.cc

      return th;
    }
    
    TFE_TensorHandle* TestMatrixTensorHandle100x100(TFE_Context* ctx) {
      constexpr int64_t dims[] = {100, 100};
      constexpr int num_elements = dims[0] * dims[1];
      float data[num_elements];
      for (int i = 0; i < num_elements; ++i) {
        data[i] = 1.0f;
      }
      TF_Status* status = TF_NewStatus();
      TF_Tensor* t = TFE_AllocateHostTensor(ctx, TF_FLOAT, &dims[0],
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Wed Feb 21 22:37:46 GMT 2024
    - 23.5K bytes
    - Viewed (2)
Back to top