tf.raw_ops.RestoreSlice
Stay organized with collections
Save and categorize content based on your preferences.
Restores a tensor from checkpoint files.
tf.raw_ops.RestoreSlice(
file_pattern,
tensor_name,
shape_and_slice,
dt,
preferred_shard=-1,
name=None
)
This is like Restore
except that restored tensor can be listed as filling
only a slice of a larger tensor. shape_and_slice
specifies the shape of the
larger tensor and the slice that the restored tensor covers.
The shape_and_slice
input has the same format as the
elements of the shapes_and_slices
input of the SaveSlices
op.
Args |
file_pattern
|
A Tensor of type string .
Must have a single element. The pattern of the files from
which we read the tensor.
|
tensor_name
|
A Tensor of type string .
Must have a single element. The name of the tensor to be
restored.
|
shape_and_slice
|
A Tensor of type string .
Scalar. The shapes and slice specifications to use when
restoring a tensors.
|
dt
|
A tf.DType . The type of the tensor to be restored.
|
preferred_shard
|
An optional int . Defaults to -1 .
Index of file to open first if multiple files match
file_pattern . See the documentation for Restore .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type dt .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.RestoreSlice\n\n\u003cbr /\u003e\n\nRestores a tensor from checkpoint files.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.RestoreSlice`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/RestoreSlice)\n\n\u003cbr /\u003e\n\n tf.raw_ops.RestoreSlice(\n file_pattern,\n tensor_name,\n shape_and_slice,\n dt,\n preferred_shard=-1,\n name=None\n )\n\nThis is like `Restore` except that restored tensor can be listed as filling\nonly a slice of a larger tensor. `shape_and_slice` specifies the shape of the\nlarger tensor and the slice that the restored tensor covers.\n\nThe `shape_and_slice` input has the same format as the\nelements of the `shapes_and_slices` input of the `SaveSlices` op.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `file_pattern` | A `Tensor` of type `string`. Must have a single element. The pattern of the files from which we read the tensor. |\n| `tensor_name` | A `Tensor` of type `string`. Must have a single element. The name of the tensor to be restored. |\n| `shape_and_slice` | A `Tensor` of type `string`. Scalar. The shapes and slice specifications to use when restoring a tensors. |\n| `dt` | A [`tf.DType`](../../tf/dtypes/DType). The type of the tensor to be restored. |\n| `preferred_shard` | An optional `int`. Defaults to `-1`. Index of file to open first if multiple files match `file_pattern`. See the documentation for `Restore`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` of type `dt`. ||\n\n\u003cbr /\u003e"]]