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

Function _tensor_name_base

tensorflow/lite/python/op_hint.py:878–891  ·  view source on GitHub ↗

Removes the device assignment code from a tensor. e.g. _tensor_name_base("foo:3") => "foo" Args: full_tensor_name: A tensor name that is annotated with a device placement (this is what tensor flow introspection gives). Returns: A name without any device assignment.

(full_tensor_name)

Source from the content-addressed store, hash-verified

876
877
878def _tensor_name_base(full_tensor_name):
879 """Removes the device assignment code from a tensor.
880
881 e.g. _tensor_name_base("foo:3") => "foo"
882
883 Args:
884 full_tensor_name: A tensor name that is annotated with a device placement
885 (this is what tensor flow introspection gives).
886 Returns:
887 A name without any device assignment.
888 """
889 if full_tensor_name.startswith("^"):
890 return full_tensor_name[1:]
891 return full_tensor_name.split(":")[0]
892
893
894def _tensorflow_output_name(tensor_name, output_index):

Callers 8

__init__Method · 0.85
addMethod · 0.85
flattenMethod · 0.85
_find_children_hintsFunction · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected