T - data type for tensor() output@Operator public final class Restore<T> extends PrimitiveOp implements Operand<T>
Reads a tensor stored in one or several files. If there are several files (for instance because a tensor was saved as slices), `file_pattern` may contain wildcard symbols (`*` and `?`) in the filename portion only, not in the directory portion.
If a `file_pattern` matches several files, `preferred_shard` can be used to hint in which file the requested tensor is likely to be found. This op will first open the file at index `preferred_shard` in the list of matching files and try to restore tensors from that file. Only if some tensors or tensor slices are not found in that first file, then the Op opens all the files. Setting `preferred_shard` to match the value passed as the `shard` input of a matching `Save` Op may speed up Restore. This attribute only affects performance, not correctness. The default value -1 means files are processed in order.
See also `RestoreSlice`.
| Modifier and Type | Class and Description |
|---|---|
static class |
Restore.Options
Optional attributes for
Restore |
operation| Modifier and Type | Method and Description |
|---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T> Restore<T> |
create(Scope scope,
Operand<String> filePattern,
Operand<String> tensorName,
Class<T> dt,
Restore.Options... options)
Factory method to create a class to wrap a new Restore operation to the graph.
|
static Restore.Options |
preferredShard(Long preferredShard) |
Output<T> |
tensor()
The restored tensor.
|
equals, hashCode, toStringpublic static <T> Restore<T> create(Scope scope, Operand<String> filePattern, Operand<String> tensorName, Class<T> dt, Restore.Options... options)
scope - current graph scopefilePattern - Must have a single element. The pattern of the files from
which we read the tensor.tensorName - Must have a single element. The name of the tensor to be
restored.dt - The type of the tensor to be restored.options - carries optional attributes valuespublic static Restore.Options preferredShard(Long preferredShard)
preferredShard - Index of file to open first if multiple files match
`file_pattern`.public Output<T> asOutput()
OperandInputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput in interface Operand<T>OperationBuilder.addInput(Output)Copyright © 2015–2019. All rights reserved.