Пример #1
0
 def testStatusDoesNotLeak(self):
   try:
     pywrap_tensorflow.DeleteFile(compat.as_bytes("/DOES_NOT_EXIST/"))
   except:
     pass
   gc.collect()
   self.assertEqual(0, self._CountReferences(c_api_util.ScopedTFStatus))
 def testStatusDoesNotLeak(self):
     try:
         with errors.raise_exception_on_not_ok_status() as status:
             pywrap_tensorflow.DeleteFile(
                 compat.as_bytes("/DOES_NOT_EXIST/"), status)
     except:
         pass
     gc.collect()
     self.assertEqual(0, self._CountReferences(c_api_util.ScopedTFStatus))
Пример #3
0
def delete_file_v2(path):
  """Deletes the path located at 'path'.

  Args:
    path: string, a path

  Raises:
    errors.OpError: Propagates any errors reported by the FileSystem API.  E.g.,
    NotFoundError if the path does not exist.
  """
  pywrap_tensorflow.DeleteFile(compat.as_bytes(path))
Пример #4
0
def delete_file_v2(path):
    """Deletes the path located at 'path'.

  Args:
    path: string, a path

  Raises:
    errors.OpError: Propagates any errors reported by the FileSystem API.  E.g.,
    NotFoundError if the path does not exist.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        pywrap_tensorflow.DeleteFile(compat.as_bytes(path), status)
Пример #5
0
def delete_file(filename):
    """Deletes the file located at 'filename'.

  Args:
    filename: string, a filename

  Raises:
    errors.OpError: Propagates any errors reported by the FileSystem API.  E.g.,
    NotFoundError if the file does not exist.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        pywrap_tensorflow.DeleteFile(compat.as_bytes(filename), status)
Пример #6
0
def delete_file(filename):
  with errors.raise_exception_on_not_ok_status() as status:
    pywrap_tensorflow.DeleteFile(compat.as_bytes(filename), status)