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

Method NewService

tensorflow/compiler/xla/service/local_service.cc:47–65  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

45namespace xla {
46
47/* static */ StatusOr<std::unique_ptr<LocalService>> LocalService::NewService(
48 const ServiceOptions& options) {
49 se::Platform* platform = options.platform();
50 if (platform == nullptr) {
51 TF_ASSIGN_OR_RETURN(platform, PlatformUtil::GetDefaultPlatform());
52 }
53
54 BackendOptions backend_options;
55 backend_options.set_platform(platform)
56 .set_intra_op_parallelism_threads(options.intra_op_parallelism_threads())
57 .set_allowed_devices(options.allowed_devices());
58
59 TF_ASSIGN_OR_RETURN(std::unique_ptr<Backend> backend,
60 Backend::CreateBackend(backend_options));
61
62 std::unique_ptr<LocalService> service(
63 new LocalService(options, std::move(backend)));
64 return std::move(service);
65}
66
67LocalService::LocalService(const ServiceOptions& options,
68 std::unique_ptr<Backend> execute_backend)

Callers

nothing calls this directly

Calls 4

TF_ASSIGN_OR_RETURNFunction · 0.70
platformMethod · 0.45

Tested by

no test coverage detected