Esempio n. 1
0
def copy_v2(src, dst, overwrite=False):
  """Copies data from `src` to `dst`.

  Args:
    src: string, name of the file whose contents need to be copied
    dst: string, name of the file to which to copy to
    overwrite: boolean, if false it's an error for `dst` to be occupied by an
      existing file.

  Raises:
    errors.OpError: If the operation fails.
  """
  pywrap_tensorflow.CopyFile(
      compat.as_bytes(src), compat.as_bytes(dst), overwrite)
Esempio n. 2
0
def copy_v2(src, dst, overwrite=False):
    """Copies data from src to dst.

  Args:
    src: string, name of the file whose contents need to be copied
    dst: string, name of the file to which to copy to
    overwrite: boolean, if false its an error for newpath to be occupied by an
        existing file.

  Raises:
    errors.OpError: If the operation fails.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        pywrap_tensorflow.CopyFile(compat.as_bytes(src), compat.as_bytes(dst),
                                   overwrite, status)
Esempio n. 3
0
def copy(oldpath, newpath, overwrite=False):
    """Copies data from oldpath to newpath.

  Args:
    oldpath: string, name of the file who's contents need to be copied
    newpath: string, name of the file to which to copy to
    overwrite: boolean, if false its an error for newpath to be occupied by an
        existing file.

  Raises:
    errors.OpError: If the operation fails.
  """
    with errors.raise_exception_on_not_ok_status() as status:
        pywrap_tensorflow.CopyFile(compat.as_bytes(oldpath),
                                   compat.as_bytes(newpath), overwrite, status)
Esempio n. 4
0
def copy(oldpath, newpath, overwrite=False):
  with errors.raise_exception_on_not_ok_status() as status:
    pywrap_tensorflow.CopyFile(compat.as_bytes(oldpath),
                               compat.as_bytes(newpath), overwrite, status)