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

Method _file_path_value

tensorflow/contrib/session_bundle/exporter.py:321–332  ·  view source on GitHub ↗

Returns the filepath value stored in constant `path_tensor`.

(self, path_tensor)

Source from the content-addressed store, hash-verified

319 return export_dir
320
321 def _file_path_value(self, path_tensor):
322 """Returns the filepath value stored in constant `path_tensor`."""
323 if not isinstance(path_tensor, ops.Tensor):
324 raise TypeError("tensor is not a Tensor")
325 if path_tensor.op.type != "Const":
326 raise TypeError("Only constants tensor are supported")
327 if path_tensor.dtype != dtypes.string:
328 raise TypeError("File paths should be string")
329 str_value = path_tensor.op.get_attr("value").string_val
330 if len(str_value) != 1:
331 raise TypeError("Only scalar tensors are supported")
332 return str_value[0]

Callers 1

initMethod · 0.95

Calls 1

get_attrMethod · 0.45

Tested by

no test coverage detected