MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TFE_TensorHandleCopyToDevice

Function TFE_TensorHandleCopyToDevice

tensorflow/c/eager/c_api.cc:908–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908TFE_TensorHandle* TFE_TensorHandleCopyToDevice(TFE_TensorHandle* h,
909 TFE_Context* ctx,
910 const char* device_name,
911 TF_Status* status) {
912 tensorflow::TensorHandle* handle = nullptr;
913 tensorflow::Device* device;
914 status->status = ctx->context->FindDeviceFromName(device_name, &device);
915 if (!status->status.ok()) {
916 return nullptr;
917 }
918 status->status = tensorflow::EagerCopyToDevice(h->handle, ctx->context,
919 ctx->context->Executor(),
920 device, false, &handle);
921 if (status->status.ok()) {
922 return new TFE_TensorHandle(handle);
923 }
924 return nullptr;
925}
926
927void TFE_ContextAddFunctionDef(TFE_Context* ctx,
928 const char* serialized_function_def, size_t size,

Calls 4

EagerCopyToDeviceFunction · 0.85
FindDeviceFromNameMethod · 0.80
okMethod · 0.45
ExecutorMethod · 0.45