Rewrites computation for execution on a TPU system.

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 of rewrite is a list of tensors corresponding to the tensors from the output of computation.

All Operations constructed during computation will be executed when evaluating any of the returned output tensors, not just the ones returned.

inputs A list of input tensors or None (equivalent to an empty list). Each input can be a nested structure containing values that are convertible to tensors. Note that passing an N-dimension list of compatible values will result in a N-dimension list of scalar tensors rather than a single Rank-N tensors. If you need different behavior, convert part of inputs to tensors with tf.convert_to_tensor.
infeed_queue If not None, the InfeedQueue from which to append a tuple of arguments as inputs to computation.
device_assignment if