def is_directory_v2(path): """Returns whether the path is a directory or not. Args: path: string, path to a potential directory Returns: True, if the path is a directory; False otherwise """ status = c_api_util.ScopedTFStatus() return pywrap_tensorflow.IsDirectory(compat.as_bytes(path), status)
def is_directory(dirname): """Returns whether the path is a directory or not. Args: dirname: string, path to a potential directory Returns: True, if the path is a directory; False otherwise """ try: status = pywrap_tensorflow.TF_NewStatus() return pywrap_tensorflow.IsDirectory(compat.as_bytes(dirname), status) finally: pywrap_tensorflow.TF_DeleteStatus(status)
def is_directory(dirname): """Returns whether the path is a directory or not. Args: dirname: string, path to a potential directory Returns: True, if the path is a directory; False otherwise Raises: errors.OpError: If the path doesn't exist or other errors """ with errors.raise_exception_on_not_ok_status() as status: return pywrap_tensorflow.IsDirectory(compat.as_bytes(dirname), status)
def is_directory(dirname): """Returns whether the path is a directory or not. Args: dirname: string, path to a potential directory Returns: True, if the path is a directory; False otherwise Raises: errors.OpError: If the path doesn't exist or other errors """ status = pywrap_tensorflow.TF_NewStatus() return pywrap_tensorflow.IsDirectory(compat.as_bytes(dirname), status)
def is_directory(dirname): with errors.raise_exception_on_not_ok_status() as status: return pywrap_tensorflow.IsDirectory(compat.as_bytes(dirname), status)