# tensorflow::ops::RestoreSlice

`#include <io_ops.h>`

Restores a tensor from checkpoint files.

## Summary

This is like `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_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 `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/save-slices#classtensorflow_1_1ops_1_1_save_slices` op.

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- file_pattern: Must have a single element. The pattern of the files from which we read the tensor.
- tensor_name: Must have a single element. The name of the tensor to be restored.
- shape_and_slice: Scalar. The shapes and slice specifications to use when restoring a tensors.
- dt: The type of the tensor to be restored.

<br />

Optional attributes (see `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs`):

- preferred_shard: Index of file to open first if multiple files match `file_pattern`. See the documentation for `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore`.

<br />

Returns:

- `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`: The restored tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a2d2ed9358de458c5ac241a0b49dd0389(const ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input file_pattern, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input tensor_name, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input shape_and_slice, DataType dt)` ||
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a901a12a32fed966841204972e978f1e2(const ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input file_pattern, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input tensor_name, ::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input shape_and_slice, DataType dt, const https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs & attrs)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a2e52156c6ad72a0c59d36634c5a00fc2` | `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a4edd358a8874c36fb6833d1ede49ea5b` | `::https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a8fd0b9d2345f9764bce4bf60b909df4e() const ` | `::tensorflow::Node *` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1a5b9012c2e1217bc1dee69a95451e7897() const ` | ` `` ` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1aa5b92a74357789547971721a0725640b() const ` | ` `` ` |

| ### Public static functions ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice_1ab8d2e2b14f8caab4f86d94957df53eef(int64 x)` | `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs` |

| ### Structs ||
|---|---|
| [tensorflow::ops::RestoreSlice::Attrs](https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/restore-slice/attrs) | Optional attribute setters for [RestoreSlice](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice). |

## Public attributes

### operation

```
Operation operation
```

### tensor

```
::tensorflow::Output tensor
```

## Public functions

### RestoreSlice

```
 RestoreSlice(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input file_pattern,
  ::tensorflow::Input tensor_name,
  ::tensorflow::Input shape_and_slice,
  DataType dt
)
```

### RestoreSlice

```
 RestoreSlice(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input file_pattern,
  ::tensorflow::Input tensor_name,
  ::tensorflow::Input shape_and_slice,
  DataType dt,
  const RestoreSlice::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### PreferredShard

```
Attrs PreferredShard(
  int64 x
)
```