MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _MakeFunc

Function _MakeFunc

tensorflow/python/framework/op_def_library.py:216–229  ·  view source on GitHub ↗

Ensure v is a func.

(v, arg_name)

Source from the content-addressed store, hash-verified

214
215
216def _MakeFunc(v, arg_name):
217 """Ensure v is a func."""
218 if isinstance(v, attr_value_pb2.NameAttrList):
219 return v
220 fn_attr = attr_value_pb2.NameAttrList()
221 if isinstance(v, compat.bytes_or_text_types):
222 fn_attr.name = v
223 elif hasattr(v, "add_to_graph"):
224 v.add_to_graph(ops.get_default_graph())
225 fn_attr.name = v.name
226 else:
227 raise TypeError("Don't know how to convert {} to a func for "
228 "argument {}".format(v, arg_name))
229 return fn_attr
230
231
232class _OpInfo(object):

Callers 1

_apply_op_helperMethod · 0.85

Calls 2

add_to_graphMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected