hi George,
When picking into the code that should automatically treat functions as must-compile for XLA devices see
here, it seems like the check for device name is occurring before placer has the chance to place the op on the XLA device. so, at lease in the following example this code fails to treat the function as must-compile:
[assume that i am forcing TF to register the XLA_CPU device in a high priority]
import os
os.environ['TF_XLA_FLAGS']='--tf_xla_cpu_global_jit --tf_xla_enable_xla_devices '
import tensorflow as tf
a = tf.Variable([[1, 2, 3, 4],[5, 6, 7, 8]], dtype=tf.float32)
b = tf.Variable([[5, 6, 7, 8],[1, 2, 3, 4]], dtype=tf.float32)
@tf.function
def myfunc(a, b):
c = a + b
d = c * b
e = d - c
f = e / a
return f
print ( myfunc(a, b) )