pywrap_tensorflow.TFE_ContextOptionsSetDevicePlacementPolicy(
opts, self._device_policy)
if self._execution_mode == ASYNC:
- pywrap_tensorflow.TFE_ContextOptionsSetAsync(True)
+ pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True)
self._context_handle = pywrap_tensorflow.TFE_NewContext(opts, status)
finally:
pywrap_tensorflow.TFE_DeleteContextOptions(opts)
self.assertTrue(has_cpu_device)
del ctx
+ def testAsyncBasic(self):
+ ctx = context.Context(execution_mode=context.ASYNC)
+ has_cpu_device = False
+ for x in ctx.devices():
+ has_cpu_device = has_cpu_device or 'CPU' in x
+ self.assertTrue(has_cpu_device)
+ del ctx
+
def testRunMetadata(self):
context.enable_run_metadata()
t = constant_op.constant(1.0)