- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for to_tensor (0.09 sec)
-
tensorflow/c/c_test_util.h
using ::tensorflow::string; typedef std::unique_ptr<TF_Tensor, decltype(&TF_DeleteTensor)> unique_tensor_ptr; TF_Tensor* BoolTensor(int32_t v); // Create a tensor with values of type TF_INT8 provided by `values`. TF_Tensor* Int8Tensor(const int64_t* dims, int num_dims, const char* values); // Create a tensor with values of type TF_INT32 provided by `values`. TF_Tensor* Int32Tensor(const int64_t* dims, int num_dims,
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Thu Aug 09 01:06:53 UTC 2018 - 6K bytes - Viewed (0) -
tensorflow/c/eager/gradient_checker.cc
theta_inputs[i] = inputs[i]; } AbstractTensorHandle* theta = theta_inputs[input_index]; // parameter we are grad checking // 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);
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/eager/gradient_checker_test.cc
#include "tensorflow/c/eager/c_api_unified_experimental.h" #include "tensorflow/c/eager/unified_api_testutil.h" #include "tensorflow/c/experimental/ops/math_ops.h" #include "tensorflow/c/tf_status_helper.h" #include "tensorflow/c/tf_tensor.h" #include "tensorflow/core/platform/tensor_float_32_utils.h" #include "tensorflow/core/platform/test.h" namespace tensorflow { namespace gradients { namespace internal { namespace {
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_remote_test.cc
TFE_TensorHandle* retvals[1]; int num_retvals = 1; TFE_Execute(matmul, &retvals[0], &num_retvals, status); EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status); TF_Tensor* t = TFE_TensorHandleResolve(retvals[0], status); ASSERT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status); float product[4] = {0}; EXPECT_EQ(sizeof(product), TF_TensorByteSize(t));
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Wed Aug 12 00:14:22 UTC 2020 - 5.4K bytes - Viewed (0) -
tensorflow/c/eager/dlpack_test.cc
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; dltensor_in->data = data.data(); dltensor_in->device = {kDLCPU, 0}; dltensor_in->ndim = static_cast<int32_t>(shape.size()); dltensor_in->dtype = {kDLFloat, 32, 1}; dltensor_in->shape = shape.data();
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Fri Jun 30 03:04:46 UTC 2023 - 4.4K bytes - Viewed (0) -
tensorflow/c/c_test.c
TF_DeleteStatus(s); return NULL; } // A compute function. This will never actually get called in this test, it's // just nice to know that it compiles. void compute(void* kernel, TF_OpKernelContext* ctx) { TF_Tensor* input; TF_Status* s = TF_NewStatus(); TF_GetInput(ctx, 0, &input, s); TF_DeleteTensor(input); TF_DeleteStatus(s); } // Exercises tensorflow's C API. int main(int argc, char** argv) {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Wed Apr 24 20:50:35 UTC 2024 - 2.8K bytes - Viewed (0) -
tensorflow/c/eager/c_api_test_util.h
template <class T, TF_DataType datatype> TFE_TensorHandle* TestTensorHandleWithDims(TFE_Context* ctx, const T* data, const int64_t* dims, int num_dims) { TF_Status* status = TF_NewStatus(); TF_Tensor* t = TFE_AllocateHostTensor(ctx, datatype, dims, num_dims, status); memcpy(TF_TensorData(t), data, TF_TensorByteSize(t)); TFE_TensorHandle* th = TFE_NewTensorHandleFromTensor(ctx, t, status);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Mon Jul 17 23:43:59 UTC 2023 - 7.7K bytes - Viewed (0) -
tensorflow/c/eager/gradients_test.cc
#include "tensorflow/c/experimental/ops/array_ops.h" #include "tensorflow/c/experimental/ops/math_ops.h" #include "tensorflow/c/tf_status_helper.h" #include "tensorflow/c/tf_tensor.h" #include "tensorflow/core/lib/llvm_rtti/llvm_rtti.h" #include "tensorflow/core/platform/errors.h" #include "tensorflow/core/platform/test.h" namespace tensorflow { namespace gradients { namespace internal {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 7K bytes - Viewed (0) -
tensorflow/c/eager/c_api_remote_test_util.cc
} auto* retval_task0 = TFE_TensorHandleCopyToDevice( retvals[0], ctx, "/job:localhost/replica:0/task:0/device:CPU:0", status); ASSERT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status); TF_Tensor* t = TFE_TensorHandleResolve(retval_task0, status); ASSERT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status); TFE_DeleteTensorHandle(retval_task0); float product[4] = {0};
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Fri Dec 11 22:56:03 UTC 2020 - 9.1K bytes - Viewed (0)