Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Int32 (0.17 sec)

  1. 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 = {};
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri Jun 30 03:04:46 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  2. tensorflow/c/eager/gradient_checker.cc

    namespace gradients {
    
    using namespace std;
    
    // ================== Helper functions =================
    
    // Fills data with values [start,end) with given step size.
    void Range(vector<int32_t>* data, int32_t start, int32_t end,
               int32_t step = 1) {
      for (int32_t i = start; i < end; i += step) {
        (*data)[i] = i;
      }
    }
    
    // Fills out_dims with the dimensions of the given tensor.
    void GetDims(const TF_Tensor* t, int64_t* out_dims) {
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  3. tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem.cc

      while (n > 0) {
        // Some platforms, notably macs, throw `EINVAL` if `pread` is asked to read
        // more than fits in a 32-bit integer.
        size_t requested_read_length;
        if (n > INT32_MAX)
          requested_read_length = INT32_MAX;
        else
          requested_read_length = n;
    
        // `pread` returns a `ssize_t` on POSIX, but due to interface being
        // cross-platform, return type of `Read` is `int64_t`.
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Sun Mar 24 20:08:23 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/next_pluggable_device/tensor_pjrt_buffer_util_test.cc

      }
      auto pjrt_client = xla::GetCApiClient(DEVICE_CPU);
      CHECK_OK(pjrt_client.status());
      auto c_api_client = down_cast<xla::PjRtCApiClient*>(pjrt_client->get());
      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(),
    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)
  5. tensorflow/c/experimental/gradients/nn_grad_test.cc

        ASSERT_EQ(errors::OK, status_.code()) << status_.message();
        X.reset(X_raw);
      }
      // Label
      int32_t Y_vals[] = {1, 0, 1};
      int64_t Y_dims[] = {3};
      AbstractTensorHandlePtr Y;
      {
        AbstractTensorHandle* Y_raw;
        status_ = TestTensorHandleWithDims<int32_t, TF_INT32>(
            immediate_execution_ctx_.get(), Y_vals, Y_dims, 1, &Y_raw);
        ASSERT_EQ(errors::OK, status_.code()) << status_.message();
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  6. tensorflow/c/eager/c_api_experimental_test.cc

        TFE_ContextSetExecutorForThread(ctx, executor);
        CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
    
        TF_Tensor* t =
            TF_AllocateTensor(TF_INT32, nullptr, 0, 1 * sizeof(tensorflow::int32));
        *reinterpret_cast<tensorflow::int32*>(TF_TensorData(t)) = 42;
        TFE_TensorHandle* h = TFE_NewTensorHandle(t, status);
        ASSERT_TRUE(TF_GetCode(status) == TF_OK) << TF_Message(status);
        TF_DeleteTensor(t);
    
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Aug 03 03:14:26 GMT 2023
    - 31.5K bytes
    - Viewed (1)
  7. tensorflow/c/c_api_test.cc

      TF_Tensor* out = csession.output_tensor(0);
      ASSERT_TRUE(out != nullptr);
      EXPECT_EQ(TF_INT32, TF_TensorType(out));
      EXPECT_EQ(0, TF_NumDims(out));  // scalar
      ASSERT_EQ(sizeof(int32), TF_TensorByteSize(out));
      int32* output_contents = static_cast<int32*>(TF_TensorData(out));
      EXPECT_EQ(3 + 2, *output_contents);
    
      // Add another operation to the graph.
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 03:35:10 GMT 2024
    - 96.9K bytes
    - Viewed (3)
  8. tensorflow/c/c_test_util.cc

                           const int32_t* values) {
      int64_t num_values = 1;
      for (int i = 0; i < num_dims; ++i) {
        num_values *= dims[i];
      }
      TF_Tensor* t =
          TF_AllocateTensor(TF_INT32, dims, num_dims, sizeof(int32_t) * num_values);
      memcpy(TF_TensorData(t), values, sizeof(int32_t) * num_values);
      return t;
    }
    
    TF_Tensor* Int32Tensor(const std::vector<int32_t>& values) {
      int64_t dims = values.size();
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri Oct 15 03:16:52 GMT 2021
    - 17.8K bytes
    - Viewed (2)
  9. tensorflow/c/eager/parallel_device/parallel_device_lib.cc

    }
    
    std::unique_ptr<ParallelTensor> ParallelDevice::DeviceIDs(
        TFE_Context* context, TF_Status* status) const {
      std::vector<int32_t> ids;
      ids.reserve(num_underlying_devices());
      for (int i = 0; i < num_underlying_devices(); ++i) {
        ids.push_back(i);
      }
      return ScalarsFromSequence<int32_t>(ids, context, status);
    }
    
    absl::optional<std::vector<std::unique_ptr<ParallelTensor>>>
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri Feb 09 07:47:20 GMT 2024
    - 25.4K bytes
    - Viewed (1)
  10. tensorflow/c/eager/dlpack.cc

        case TF_DataType::TF_FLOAT:
        case TF_DataType::TF_DOUBLE:
          dtype.code = DLDataTypeCode::kDLFloat;
          break;
        case TF_DataType::TF_INT8:
        case TF_DataType::TF_INT16:
        case TF_DataType::TF_INT32:
        case TF_DataType::TF_INT64:
          dtype.code = DLDataTypeCode::kDLInt;
          break;
        case TF_DataType::TF_UINT8:
        case TF_DataType::TF_UINT16:
        case TF_DataType::TF_UINT32:
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 12.8K bytes
    - Viewed (0)
Back to top