def validated_input(tfobj_or_name, graph):
"""
Validate and return the input names useable GraphFunction
:param graph: tf.Graph, a TensorFlow Graph object
:param tfobj_or_name: either a tf.Tensor, tf.Operation or a name to either
"""
graph = validated_graph(graph)
name = op_name(tfobj_or_name, graph)
op = graph.get_operation_by_name(name)
assert 'Placeholder' == op.type, \
('input must be Placeholder, but get', op.type)
return name
评论列表
文章目录