MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_op_tensor_name

Function get_op_tensor_name

tensorpack/tfutils/common.py:88–102  ·  view source on GitHub ↗

Will automatically determine if ``name`` is a tensor name (ends with ':x') or a op name. If it is an op name, the corresponding tensor name is assumed to be ``op_name + ':0'``. Args: name(str): name of an op or a tensor Returns: tuple: (op_name, tensor_name)

(name)

Source from the content-addressed store, hash-verified

86
87
88def get_op_tensor_name(name):
89 """
90 Will automatically determine if ``name`` is a tensor name (ends with ':x')
91 or a op name.
92 If it is an op name, the corresponding tensor name is assumed to be ``op_name + ':0'``.
93
94 Args:
95 name(str): name of an op or a tensor
96 Returns:
97 tuple: (op_name, tensor_name)
98 """
99 if len(name) >= 3 and name[-2] == ':':
100 return name[:-2], name
101 else:
102 return name, name + ':0'
103
104
105def get_tensors_by_names(names):

Callers 15

checkpoint-prof.pyFile · 0.90
_check_nameFunction · 0.85
_apply_shadow_varsMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
get_fetchesMethod · 0.85
_after_inferenceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected