Determines whether a path exists or not. Args: path: string, a path Returns: True if the path exists, whether it's a file or a directory. False if the path does not exist and there are no filesystem errors. Raises: errors.OpError: Propagates any errors reported by the FileSy
(path)
| 264 | |
| 265 | @tf_export("io.gfile.exists") |
| 266 | def file_exists_v2(path): |
| 267 | """Determines whether a path exists or not. |
| 268 | |
| 269 | Args: |
| 270 | path: string, a path |
| 271 | |
| 272 | Returns: |
| 273 | True if the path exists, whether it's a file or a directory. |
| 274 | False if the path does not exist and there are no filesystem errors. |
| 275 | |
| 276 | Raises: |
| 277 | errors.OpError: Propagates any errors reported by the FileSystem API. |
| 278 | """ |
| 279 | try: |
| 280 | pywrap_tensorflow.FileExists(compat.as_bytes(path)) |
| 281 | except errors.NotFoundError: |
| 282 | return False |
| 283 | return True |
| 284 | |
| 285 | |
| 286 | @tf_export(v1=["gfile.Remove"]) |
no test coverage detected