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

Function EagerExecute

tensorflow/core/common_runtime/eager/execute.cc:904–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902} // namespace
903
904Status EagerExecute(EagerOperation* op,
905 gtl::InlinedVector<TensorHandle*, 2>* retvals,
906 int* num_retvals) {
907 profiler::TraceMe activity(
908 [&] { return absl::StrCat("EagerExecute: ", op->Name()); },
909 profiler::TraceMeLevel::kInfo);
910 TF_RETURN_IF_ERROR(MaybeUpdateOpDevice(op));
911
912 bool op_is_local = op->EagerContext()->IsLocalDeviceName(op->GetDeviceName());
913
914 std::unique_ptr<tensorflow::EagerOperation> out_op;
915 TF_RETURN_IF_ERROR(EagerOpRewriteRegistry::Global()->RunRewrite(
916 EagerOpRewriteRegistry::PRE_EXECUTION, op, &out_op));
917
918 if (op_is_local) {
919 if (out_op) {
920 op = out_op.get();
921 }
922 return EagerLocalExecute(op, retvals->data(), num_retvals);
923 }
924
925 if (op->EagerContext()->LogDevicePlacement() || VLOG_IS_ON(1)) {
926 string msg = strings::StrCat(
927 "Executing op ", op->Name(), " on task ",
928 DeviceNameUtils::ParsedNameToString(op->GetDeviceName()));
929 if (!logging::LogToListeners(msg)) {
930 LOG(INFO) << msg;
931 }
932 }
933
934#if defined(IS_MOBILE_PLATFORM)
935 return errors::Unimplemented(
936 "Eager's remote execution is not available on mobile devices.");
937#else // !IS_MOBILE_PLATFORM
938 if (out_op) {
939 op = out_op.get();
940 }
941 return EagerRemoteExecute(op, retvals->data(), num_retvals);
942#endif // !IS_MOBILE_PLATFORM
943}
944
945// TODO(gjn): Consider moving into ExecuteNode class
946Status EagerKernelExecute(EagerContext* ctx,

Callers 3

ExecuteFlexOpFunction · 0.85
ExecuteOpMethod · 0.85
TFE_ExecuteFunction · 0.85

Calls 14

MaybeUpdateOpDeviceFunction · 0.85
EagerLocalExecuteFunction · 0.85
LogToListenersFunction · 0.85
UnimplementedFunction · 0.85
EagerRemoteExecuteFunction · 0.85
IsLocalDeviceNameMethod · 0.80
RunRewriteMethod · 0.80
LogDevicePlacementMethod · 0.80
StrCatFunction · 0.50
NameMethod · 0.45
EagerContextMethod · 0.45
GetDeviceNameMethod · 0.45

Tested by

no test coverage detected