\
REGISTER_KERNEL_BUILDER( \
Name("VarHandleOp").Device(DEVICE).HostMemory("resource"), \
- ResourceHandleOp<Var>);
+ ResourceHandleOp<Var>); \
+ REGISTER_KERNEL_BUILDER(Name("ControlTrigger").Device(DEVICE), \
+ ControlTriggerOp);
} // namespace tensorflow
from tensorflow.compiler.tests.xla_test import XLATestCase
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
+from tensorflow.python.ops import gen_control_flow_ops
from tensorflow.python.platform import test
result = sess.run(z, {x: inputs})
self.assertAllCloseAccordingToType(result, inputs + inputs)
+ def testControlTrigger(self):
+ with self.test_session() as sess:
+ with self.test_scope():
+ x = gen_control_flow_ops.control_trigger()
+ sess.run(x)
+
if __name__ == "__main__":
test.main()
REGISTER_XLA_OP(Name("NoOp").CompilationOnly(), NoOp);
// We register ControlTrigger as a no-op. This is correct since nodes seen
-// by the XLA compiler are never dead. This may need rethinking when we add
-// support for conditionals to XLA.
-REGISTER_XLA_OP(Name("ControlTrigger"), NoOp);
+// by the XLA compiler are never dead.
+REGISTER_XLA_OP(Name("ControlTrigger").CompilationOnly(), NoOp);
} // namespace tensorflow