Enable _USE_C_API for CondTest in control_flow_ops_test.py
The only change required to make CondTest pass is changing the various Operation methods to check self._c_op to determine if the C API is enabled, instead of self._graph._c_graph or _USE_C_API. This is because CondContext.AddOp() is called before creating self._c_op in Operation.__init__(), and AddOp() uses the Operation methods that call the C API. We need to use the original Python-only code before self._c_op has been created. I added a comment in ops.py explaining an alternative to this solution that we may wish to implement later. PiperOrigin-RevId: 170350199
Loading
Please sign in to comment