tf.xla.experimental.compile | TensorFlow v2.16.1 (original) (raw)
tf.xla.experimental.compile
Stay organized with collections Save and categorize content based on your preferences.
Builds an operator that compiles and runs computation
with XLA. (deprecated)
View aliases
Compat aliases for migration
SeeMigration guide for more details.
tf.compat.v1.xla.experimental.compile
tf.xla.experimental.compile(
computation, inputs=None
)
Args | |
---|---|
computation | A Python function that builds a computation to apply to the input. If the function takes n inputs, 'inputs' should be a list of nTensors.computation may return a list of Tensors and Operations.Tensors must come before Operations in the returned list. All Operations returned from computation will be executed when evaluating any of the returned output tensors. |
inputs | A list of inputs or None (equivalent to an empty list). Each input can be a nested structure containing values that can be converted toTensors. Note that passing an N-dimension list of compatible values will result in an N-dimension list of scalar Tensors rather than a single Rank-N Tensor. If you need a different behavior, convert parts ofinputs to Tensors with tf.convert_to_tensor. |
Returns |
---|
List of Tensors corresponding to the Tensors from the output of computation i.e. the same return value as if computation(*inputs) is called directly, with the following exceptions: None output: a NoOp would be returned with a control dependency oncomputation. Single value output: a tuple containing the value would be returned. Operation-only outputs: a NoOp would be returned with a control dependency on computation. |
Raises | |
---|---|
RuntimeError | When eager execution is enabled. |
Known issues |
---|
When a tf.random operation is built with XLA, the implementation doesn't pass the user provided seed to the XLA compiler. As such, the XLA compiler generates a random number and uses it as a seed when compiling the operation. This implementation causes a violation of the Tensorflow defined semantics in two aspects. First, changing the value of the user defined seed doesn't change the numbers generated by the operation. Second, when a seed is not specified, running the program multiple times will generate the same numbers. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.