- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 32 for to_tensor (0.14 sec)
-
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.cc
TFE_Context* ctx) { return static_cast<TFE_ContextDevicePlacementPolicy>( tensorflow::unwrap(ctx)->GetDevicePlacementPolicy()); } TFE_TensorHandle* TFE_NewTensorHandle(const TF_Tensor* t, TF_Status* status) { tensorflow::Tensor tensor; status->status = tensorflow::TF_TensorToTensor(t, &tensor); if (!status->status.ok()) return nullptr;
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 43.9K bytes - Viewed (0) -
tensorflow/c/c_api_function_test.cc
~CApiFunctionTest() override { TF_DeleteFunction(func_); TF_DeleteGraph(host_graph_); TF_DeleteGraph(func_graph_); TF_DeleteStatus(s_); } void Run(const std::vector<std::pair<TF_Operation*, TF_Tensor*>>& inputs, TF_Operation* output, int32_t expected_result) { Run(inputs, {{output, 0}}, {expected_result}); } // Run the host graph, which now contains a function and check that
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Thu Jul 20 22:08:54 UTC 2023 - 63.6K bytes - Viewed (0) -
tensorflow/c/eager/c_api_distributed_test.cc
TFE_Execute(func, &retvals[0], &num_retvals, status); EXPECT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status); ASSERT_EQ(1, num_retvals); TFE_DeleteOp(func); TFE_DeleteTensorHandle(packed_handle); TF_Tensor* t = TFE_TensorHandleResolve(retvals[0], status); ASSERT_EQ(TF_GetCode(status), TF_OK) << TF_Message(status); TFE_DeleteTensorHandle(retvals[0]); float sum = 0; EXPECT_EQ(sizeof(sum), TF_TensorByteSize(t));
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/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/parallel_device/parallel_device_lib.h
#include "tensorflow/c/eager/c_api_experimental.h" #include "tensorflow/c/eager/tfe_op_internal.h" #include "tensorflow/c/safe_ptr.h" #include "tensorflow/c/tf_datatype.h" #include "tensorflow/c/tf_status.h" #include "tensorflow/c/tf_tensor.h" #include "tensorflow/core/framework/cancellation.h" #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/status.h" namespace tensorflow {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Mon Oct 21 04:14:14 UTC 2024 - 13.1K 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) -
tensorflow/c/eager/c_api_experimental.cc
if (t == nullptr) { status->status = tensorflow::errors::InvalidArgument("Unsupported dtype: ", dtype); return nullptr; } return new TF_Tensor{t}; } TFE_TensorHandle* TFE_NewTensorHandleFromTensor(TFE_Context* ctx, TF_Tensor* t, TF_Status* status) { return tensorflow::wrap( tensorflow::unwrap(ctx)->CreateLocalHandle(t->tensor)); }
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 35.9K bytes - Viewed (0) -
tensorflow/c/eager/c_api_experimental.h
// appended later), but should include any information specific to this custom // device which would be useful for debugging. // // Optional. If null, defaults to resolving the TFE_TensorHandle into a // TF_Tensor and summarizing that. TF_Buffer* (*summarize)(void* data, TF_Status* status) = nullptr; } TFE_CustomDeviceTensorHandle; // Creates a new TensorHandle from memory residing in a custom device. Takes
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Wed Feb 21 22:37:46 UTC 2024 - 39.5K bytes - Viewed (0)