- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for TF_TensorData (0.14 sec)
-
tensorflow/c/eager/gradient_checker.cc
// 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)); // Initialize space for the numerical gradient. vector<float> dtheta_approx(num_elems); // Get theta shape and store in theta_dims.
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 7.3K bytes - Viewed (0) -
tensorflow/c/c_api_test.cc
// Check that a write to one tensor shows up in the other. *(static_cast<int64_t*>(TF_TensorData(a))) = 4; EXPECT_EQ(4, *(static_cast<int64_t*>(TF_TensorData(b)))); *(static_cast<int64_t*>(TF_TensorData(b))) = 6; EXPECT_EQ(6, *(static_cast<int64_t*>(TF_TensorData(a)))); TF_DeleteTensor(a); TF_DeleteTensor(b); } TEST(CAPI, TestFromProto) {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 16:27:48 UTC 2024 - 97K bytes - Viewed (0) -
tensorflow/c/eager/c_api_unified_experimental_test.cc
ASSERT_EQ(TF_OK, TF_GetCode(status.get())) << TF_Message(status.get()); TF_Tensor* result_tensor = TFE_TensorHandleResolve(result_t, status.get()); float* result_value = static_cast<float*>(TF_TensorData(result_tensor)); EXPECT_EQ(*result_value, 4.0); TF_DeleteTensor(result_tensor); TF_DeleteAbstractTensor(result); TF_DeleteOutputList(o); TF_DeleteExecutionContext(ctx); } // MatMul Test
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 39.1K bytes - Viewed (0) -
tensorflow/c/eager/c_api_distributed_test.cc
ASSERT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status); TFE_DeleteTensorHandle(retvals[0]); float sum = 0; EXPECT_EQ(sizeof(sum), TF_TensorByteSize(t)); memcpy(&sum, TF_TensorData(t), TF_TensorByteSize(t)); TF_DeleteTensor(t); EXPECT_EQ(sum, 6.0); TFE_DeleteTensorHandle(h0); TFE_DeleteTensorHandle(h1); TFE_DeleteTensorHandle(h2);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 23.4K bytes - Viewed (0) -
tensorflow/c/eager/gradient_checker_test.cc
auto num_elem_numerical = TF_TensorElementCount(numerical_tensor); ASSERT_EQ(num_elem_numerical, num_grad); float* dnumerical = new float[num_elem_numerical]{0}; memcpy(&dnumerical[0], TF_TensorData(numerical_tensor), TF_TensorByteSize(numerical_tensor)); for (int j = 0; j < num_grad; j++) { ASSERT_NEAR(dnumerical[j], expected_grad[j], abs_error); } delete[] dnumerical;
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 6.5K bytes - Viewed (0) -
tensorflow/c/eager/c_api_cluster_test.cc
std::unique_ptr<float[]> actual_values(new float[expected_values.size()]); EXPECT_EQ(sizeof(float) * expected_values.size(), TF_TensorByteSize(t)); memcpy(actual_values.get(), TF_TensorData(t), TF_TensorByteSize(t)); TF_DeleteTensor(t); for (int i = 0; i < expected_values.size(); i++) { EXPECT_EQ(expected_values[i], actual_values[i])
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 19.2K bytes - Viewed (0)