Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TF_AllocateTensor (0.19 sec)

  1. tensorflow/c/c_test_util.cc

    }
    
    TF_Tensor* Int8Tensor(const int64_t* dims, int num_dims, const char* values) {
      int64_t num_values = 1;
      for (int i = 0; i < num_dims; ++i) {
        num_values *= dims[i];
      }
      TF_Tensor* t =
          TF_AllocateTensor(TF_INT8, dims, num_dims, sizeof(char) * num_values);
      memcpy(TF_TensorData(t), values, sizeof(char) * num_values);
      return t;
    }
    
    TF_Tensor* Int32Tensor(const int64_t* dims, int num_dims,
    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)
  2. tensorflow/c/eager/c_api_test_util.cc

      TFE_OpSetAttrType(op, "dtype", TF_FLOAT);
      TFE_OpAddInput(op, var_handle, status);
    
      // Convert 'value' to a TF_Tensor then a TFE_TensorHandle.
      std::unique_ptr<TF_Tensor, decltype(&TF_DeleteTensor)> t(
          TF_AllocateTensor(TF_FLOAT, nullptr, 0, sizeof(value)), TF_DeleteTensor);
      memcpy(TF_TensorData(t.get()), &value, TF_TensorByteSize(t.get()));
    
      std::unique_ptr<TFE_TensorHandle, decltype(&TFE_DeleteTensorHandle)>
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Feb 21 22:37:46 GMT 2024
    - 23.5K bytes
    - Viewed (2)
  3. tensorflow/c/c_api_test.cc

      TF_DeleteStatus(status);
    }
    
    TEST(CAPI, TestBitcastFrom_Reshape) {
      int64_t dims[] = {2, 3};
      TF_Tensor* a =
          TF_AllocateTensor(TF_UINT64, dims, 2, 6 * TF_DataTypeSize(TF_UINT64));
      TF_Tensor* b =
          TF_AllocateTensor(TF_UINT64, nullptr, 0, TF_DataTypeSize(TF_UINT64));
      EXPECT_NE(a, nullptr);
      EXPECT_NE(b, nullptr);
    
      EXPECT_EQ(6, TF_TensorElementCount(a));
    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)
  4. tensorflow/c/eager/c_api_experimental_test.cc

            /*in_flight_nodes_limit=*/0);
        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);
    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)
  5. tensorflow/c/eager/c_api_test.cc

      std::vector<int64_t> dims(4, 1);
      TFE_Op* op = TFE_NewOp(ctx, "AvgPool", status);
      ASSERT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
    
      TF_Tensor* tensor =
          TF_AllocateTensor(TF_FLOAT, dims.data(), dims.size(), sizeof(float));
      float tensor_data[] = {1};
      memcpy(TF_TensorData(tensor), tensor_data, TF_TensorByteSize(tensor));
    C++
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Aug 03 20:50:20 GMT 2023
    - 94.6K bytes
    - Viewed (1)
Back to top