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

Method Compile

tensorflow/compiler/xla/client/local_client.cc:340–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340StatusOr<std::vector<std::unique_ptr<LocalExecutable>>> LocalClient::Compile(
341 const XlaComputation& computation,
342 const absl::Span<const Shape* const> argument_layouts,
343 const ExecutableBuildOptions& options) {
344 ExecutableBuildOptions updated_options = options;
345 if (options.device_ordinal() == -1) {
346 updated_options.set_device_ordinal(default_device_ordinal());
347 VLOG(3) << "Set device ordinal to default value of: "
348 << updated_options.device_ordinal();
349 }
350 TF_ASSIGN_OR_RETURN(std::vector<std::unique_ptr<Executable>> executables,
351 local_service_->CompileExecutables(
352 computation, argument_layouts, updated_options));
353
354 std::vector<std::unique_ptr<LocalExecutable>> local_executables;
355 local_executables.reserve(executables.size());
356
357 for (auto& executable : executables) {
358 local_executables.push_back(absl::make_unique<LocalExecutable>(
359 std::move(executable), local_service_->mutable_backend(),
360 updated_options));
361 }
362
363 return std::move(local_executables);
364}
365
366StatusOr<ScopedShapedBuffer> LocalClient::LiteralToShapedBuffer(
367 const LiteralSlice& literal, int device_ordinal,

Callers

nothing calls this directly

Calls 7

CompileExecutablesMethod · 0.80
TF_ASSIGN_OR_RETURNFunction · 0.50
device_ordinalMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
mutable_backendMethod · 0.45

Tested by

no test coverage detected