Compiles a computation. Computations are the result of a "ComputationBuild'ing" process. Arguments: argument_shapes: Deprecated. Use compile_options.argument_layouts instead. compile_options: options to use for compilation, includes an optional laid out result shape for
(self, argument_shapes=None, compile_options=None, backend=None)
| 565 | return self.computation.GetHloDotGraph() |
| 566 | |
| 567 | def Compile(self, argument_shapes=None, compile_options=None, backend=None): |
| 568 | """Compiles a computation. |
| 569 | |
| 570 | Computations are the result of a "ComputationBuild'ing" process. |
| 571 | |
| 572 | Arguments: |
| 573 | argument_shapes: Deprecated. Use compile_options.argument_layouts instead. |
| 574 | compile_options: options to use for compilation, includes an optional laid |
| 575 | out result shape for the computation. |
| 576 | backend: a `Backend` for which an executable should be generated. |
| 577 | |
| 578 | Returns: |
| 579 | A Executable instance. |
| 580 | """ |
| 581 | backend = backend or self._backend or get_local_backend() |
| 582 | |
| 583 | compile_options = compile_options or CompileOptions() |
| 584 | if argument_shapes: |
| 585 | compile_options.argument_layouts = argument_shapes |
| 586 | return backend.compile(self.computation, compile_options) |
| 587 | |
| 588 | def GetProgramShape(self): |
| 589 | return self._c_computation.GetProgramShape() |
no test coverage detected