Restore

public final class Restore

Restores tensors from a V2 checkpoint.

For backward compatibility with the V1 format, this Op currently allows restoring from a V1 checkpoint as well: - This Op first attempts to find the V2 index file pointed to by "prefix", and if found proceed to read it as a V2 checkpoint; - Otherwise the V1 read path is invoked. Relying on this behavior is not recommended, as the ability to fall back to read V1 might be deprecated and eventually removed.

By default, restores the named tensors in full. If the caller wishes to restore specific slices of stored tensors, "shape_and_slices" should be non-empty strings and correspondingly well-formed.

Callers must ensure all the named tensors are indeed stored in the checkpoint.

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static Restore
create(Scope scope, Operand<TString> prefix, Operand<TString> tensorNames, Operand<TString> shapeAndSlices, List<Class<? extends TType>> dtypes)
Factory method to create a class wrapping a new Restore operation.
Iterator<Operand<TType>>
List<Output<?>>
tensors()
shape {N}.

Inherited Methods

org.tensorflow.op.RawOp
final boolean
equals(Object obj)
final int
Operation
op()
Return this unit of computation as a single Operation.
final String
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.op.Op
abstract ExecutionEnvironment
env()
Return the execution environment this op was created in.
abstract Operation
op()
Return this unit of computation as a single Operation.
abstract void
forEach(Consumer<? super T> arg0)
abstract Iterator<Operand<TType>>
iterator()
abstract Spliterator<Operand<TType>>
spliterator()

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "RestoreV2"

Public Methods

public static Restore create (Scope scope, Operand<TString> prefix, Operand<TString> tensorNames, Operand<TString> shapeAndSlices, List<Class<? extends TType>> dtypes)

Factory method to create a class wrapping a new Restore operation.

Parameters
scope current scope
prefix Must have a single element. The prefix of a V2 checkpoint.
tensorNames shape {N}. The names of the tensors to be restored.
shapeAndSlices shape {N}. The slice specs of the tensors to be restored. Empty strings indicate that they are non-partitioned tensors.
dtypes shape {N}. The list of expected dtype for the tensors. Must match those stored in the checkpoint.
Returns
  • a new instance of Restore

public Iterator<Operand<TType>> iterator ()

public List<Output<?>> tensors ()

shape {N}. The restored tensors, whose shapes are read from the checkpoint directly.