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

Function XlaCompiledProgramShape

tensorflow/compiler/xrt/tests/raw_api_test.cc:275–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275xla::ProgramShape XlaCompiledProgramShape(
276 const xla::XlaComputation& computation,
277 const xla::ProgramShape& input_program_shape) {
278 se::Platform* platform =
279 xla::PlatformUtil::GetPlatform(*xla_platform_ptr).ValueOrDie();
280 xla::LocalClient* client =
281 xla::ClientLibrary::GetOrCreateLocalClient(platform).ValueOrDie();
282 xla::ExecutableBuildOptions exec_options;
283 exec_options.set_result_layout(input_program_shape.result());
284 std::vector<const xla::Shape*> parameters_shapes;
285 for (int64 i = 0; i < input_program_shape.parameters_size(); ++i) {
286 parameters_shapes.push_back(&input_program_shape.parameters(i));
287 }
288 std::vector<std::unique_ptr<xla::LocalExecutable>> local_executables =
289 client->Compile(computation, parameters_shapes, exec_options)
290 .ConsumeValueOrDie();
291 EXPECT_EQ(local_executables.size(), 1);
292 std::unique_ptr<xla::LocalExecutable> local_executable =
293 std::move(local_executables[0]);
294 return local_executable->executable()
295 ->module()
296 .entry_computation()
297 ->ComputeProgramShape();
298}
299
300TEST(RawApiTest, AllocFromTensor) {
301 xla::Literal literal =

Callers 1

TESTFunction · 0.85

Calls 11

parameters_sizeMethod · 0.80
ConsumeValueOrDieMethod · 0.80
entry_computationMethod · 0.80
resultMethod · 0.45
push_backMethod · 0.45
parametersMethod · 0.45
CompileMethod · 0.45
sizeMethod · 0.45
ComputeProgramShapeMethod · 0.45
moduleMethod · 0.45
executableMethod · 0.45

Tested by

no test coverage detected