def device_fn(device):
""" Returns a function that given a tf.Operation it returns what device to put it on """
def function(operation):
""" Given a tf.Operation returns what device to put it on """
if operation.type in _CPU_OPERATIONS:
return '/cpu:0'
else:
return device
return function
评论列表
文章目录