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

Method get_tensor_by_name

tensorflow/python/framework/ops.py:3775–3794  ·  view source on GitHub ↗

Returns the `Tensor` with the given `name`. This method may be called concurrently from multiple threads. Args: name: The name of the `Tensor` to return. Returns: The `Tensor` with the given `name`. Raises: TypeError: If `name` is not a string. KeyError: I

(self, name)

Source from the content-addressed store, hash-verified

3773 return self._get_operation_by_name_unsafe(op_name)
3774
3775 def get_tensor_by_name(self, name):
3776 """Returns the `Tensor` with the given `name`.
3777
3778 This method may be called concurrently from multiple threads.
3779
3780 Args:
3781 name: The name of the `Tensor` to return.
3782
3783 Returns:
3784 The `Tensor` with the given `name`.
3785
3786 Raises:
3787 TypeError: If `name` is not a string.
3788 KeyError: If `name` does not correspond to a tensor in this graph.
3789 """
3790 # Names should be strings.
3791 if not isinstance(name, six.string_types):
3792 raise TypeError("Tensor names are strings (or similar), not %s." %
3793 type(name).__name__)
3794 return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
3795
3796 def _get_tensor_by_tf_output(self, tf_output):
3797 """Returns the `Tensor` representing `tf_output`.

Callers 15

testMetaGraphSaveLoadMethod · 0.95
testBasicMethod · 0.95
test_load_graphMethod · 0.95
_import_and_inferFunction · 0.95
_import_and_inferFunction · 0.95
beginMethod · 0.80
_get_masked_weightsFunction · 0.80
_get_outputsMethod · 0.80
find_corresponding_elemFunction · 0.80

Calls 2

as_graph_elementMethod · 0.95
typeFunction · 0.85

Tested by 15

testMetaGraphSaveLoadMethod · 0.76
testBasicMethod · 0.76
test_load_graphMethod · 0.76
_import_and_inferFunction · 0.76
_import_and_inferFunction · 0.76
_get_outputsMethod · 0.64
testRuntimeFailuresMethod · 0.64
test1Workers2PeriodMethod · 0.64