tf.contrib.tpu.rewrite(
computation,
inputs=None,
infeed_queue=None,
device_assignment=None,
name=None
)
Defined in tensorflow/contrib/tpu/python/tpu/tpu.py
.
Rewrites computation
for execution on a TPU system.
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 n tensors.computation
may return a list of operations and tensors. Tensors must come before operations in the returned list. The return value ofrewrite
is a list of tensors corresponding to the tensors from the output ofcomputation
.All
Operation
s constructed duringcomputation
will be executed when evaluating any of the returned output tensors, not just the ones returned.inputs
: A list of input tensors orNone
(equivalent to an empty list).infeed_queue
: If notNone
, theInfeedQueue
from which to append a tuple of arguments as inputs tocomputation
.device_assignment
: if notNone
, aDeviceAssignment
describing the mapping between logical cores in the computation with physical cores in the TPU topology. May be omitted for a single-core computation, in which case the core attached to task 0, TPU device 0 is used.name
: (Deprecated) Does nothing.
Returns:
A list of output tensors.