Merge pull request #32202 from Huawei-MRC-OSI:check-name-types
PiperOrigin-RevId: 314626868 Change-Id: I58cf3f4f12b7f36b4ae226d3f371da3f429f20e3
This commit is contained in:
commit
70fd126d3a
|
@ -117,6 +117,12 @@ def get_tensors_from_tensor_names(graph, tensor_names):
|
|||
tensors = []
|
||||
invalid_tensors = []
|
||||
for name in tensor_names:
|
||||
if not isinstance(name, six.string_types):
|
||||
raise ValueError("Invalid type for a tensor name in the provided graph. "
|
||||
"Expected type for a tensor name is 'str', instead got "
|
||||
"type '{}' for tensor name '{}'".format(
|
||||
type(name), name))
|
||||
|
||||
tensor = tensor_name_to_tensor.get(name)
|
||||
if tensor is None:
|
||||
invalid_tensors.append(name)
|
||||
|
|
Loading…
Reference in New Issue