Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for src_buffer (0.11 sec)

  1. tensorflow/compiler/mlir/lite/utils/low_bit_utils.cc

    namespace tflite {
    
    std::vector<uint8_t> PackInt4ValuesDensely(std::vector<uint8_t> src_buffer) {
      auto num_elements = src_buffer.size();
      auto packed_size = (num_elements + 1) / 2;
      std::vector<uint8_t> packed_buffer((num_elements + 1) / 2);
    
      for (int i = 0; i < num_elements - 1; i += 2) {
        packed_buffer[i / 2] = src_buffer[i] & 0x0F;
        packed_buffer[i / 2] |= src_buffer[i + 1] << 4;
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 04 19:11:58 UTC 2023
    - 2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/low_bit_utils.h

    // filled first, followed by the upper nibble.
    std::vector<uint8_t> PackInt4ValuesDensely(std::vector<uint8_t> src_buffer);
    
    // Assumes `src_buffer` contains 2 4-bit elements packed in 8-bit.
    // Returns a vector where each int8 element contains a int4 sign-extended value.
    std::vector<char> UnpackDenseInt4IntoInt8(
        const std::vector<uint8_t>& src_buffer, int64_t num_elements);
    }  // namespace tflite
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Oct 12 20:13:51 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  3. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util_test.cc

      TF_ASSERT_OK_AND_ASSIGN(auto c_buffer, GetPjRtCBufferFromTensor(&tensor));
    
      EXPECT_THAT(c_buffer, NotNull());
    }
    
    TEST(TensorPjRtBufferUtilTest, SetPjRtCBufferToTensorNotAsyncValueTensor) {
      tensorflow::Tensor tensor(DT_FLOAT, {1});
      TF_ASSERT_OK_AND_ASSIGN(auto pjrt_client, xla::GetCApiClient(DEVICE_CPU));
      PJRT_Buffer* c_buffer = CreateCBuffer();
    
      TF_EXPECT_OK(SetPjRtCBufferToTensor(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 01 16:29:40 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/next_pluggable_device/c_api.cc

        return nullptr;
      }
      absl::StatusOr<PJRT_Buffer*> c_buffer =
          tensorflow::GetPjRtCBufferFromTensor(&tensor);
      if (!c_buffer.ok()) {
        status->status = c_buffer.status();
        return nullptr;
      }
      status->status = absl::OkStatus();
      return *c_buffer;
    }
    
    void TF_CreatePjRtBuffer(TF_Tensor* c_tensor, PJRT_Buffer* c_buffer,
                             const char* device_type, TF_Status* status) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 05:48:24 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  5. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util.cc

      }
      return c_api_buffer->c_buffer();
    }
    
    absl::Status SetPjRtCBufferToTensor(PJRT_Buffer* c_buffer,
                                        xla::PjRtCApiClient* c_api_client,
                                        Tensor* tensor) {
      auto buffer = std::make_unique<xla::PjRtCApiBuffer>(c_api_client, c_buffer);
      tensorflow::AsyncValueTensor* av_tensor =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 05:48:24 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/jit/pjrt_device_context.cc

        return;
      }
      // TODO(b/288585098): consider whether to support same device copy in PJRT
      // API.
      absl::StatusOr<PJRT_Buffer*> c_src_buffer =
          GetPjRtCBufferFromTensor(input_tensor);
      if (!c_src_buffer.ok()) {
        done(c_src_buffer.status());
        return;
      }
      absl::StatusOr<xla::PjRtCApiClient*> c_api_client =
          tensorflow::GetPjRtCApiClient(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 08:49:31 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util.h

    #include "tensorflow/core/framework/tensor.h"
    
    namespace tensorflow {
    
    absl::StatusOr<PJRT_Buffer*> GetPjRtCBufferFromTensor(const Tensor* tensor);
    
    absl::Status SetPjRtCBufferToTensor(PJRT_Buffer* c_buffer,
                                        xla::PjRtCApiClient* c_api_client,
                                        Tensor* tensor);
    
    absl::StatusOr<xla::PjRtCApiClient*> GetPjRtCApiClient(
        const DeviceType& device_type);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 05:48:24 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  8. tensorflow/c/experimental/next_pluggable_device/c_api.h

    // Creates a `PjRtCApiBuffer` with the `PJRT_Buffer*` passed in and set to the
    // tensor.
    TF_CAPI_EXPORT extern void TF_CreatePjRtBuffer(TF_Tensor* c_tensor,
                                                   PJRT_Buffer* c_buffer,
                                                   const char* device_type,
                                                   TF_Status* status);
    
    #ifdef __cplusplus
    }  // extern "C"
    #endif
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Dec 20 20:01:06 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/jit/xla_launch_util.cc

          // they have ownership of the buffer (see comment in
          // PopulateExecutionInputBuffer). Release ownership from output to avoid
          // double free.
          output.set_buffer(se::OwningDeviceMemory(), {output_num});
          return input_tensor;
        }
      }
    
      if (allocate_xla_tensors) {
        Tensor output_tensor;
        TF_RETURN_IF_ERROR(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 00:36:08 UTC 2024
    - 40.4K bytes
    - Viewed (0)
Back to top