<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/ops/variables.py#L1249-L1396) |

Information on how to save this Variable as a slice.

#### View aliases


**Main aliases**

[`tf.experimental.dtensor.DVariable.SaveSliceInfo`](https://www.tensorflow.org/api_docs/python/tf/Variable/SaveSliceInfo)
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.Variable.SaveSliceInfo`](https://www.tensorflow.org/api_docs/python/tf/Variable/SaveSliceInfo)

<br />

    tf.Variable.SaveSliceInfo(
        full_name=None,
        full_shape=None,
        var_offset=None,
        var_shape=None,
        save_slice_info_def=None,
        import_scope=None
    )

Provides internal support for saving variables as slices of a larger
variable. This API is not public and is subject to change.

#### Available properties:

- full_name
- full_shape
- var_offset
- var_shape

<br />

<br />

<br />

| ## Args ||
|---|---|
| `full_name` | Name of the full variable of which this `Variable` is a slice. |
| `full_shape` | Shape of the full variable, as a list of int. |
| `var_offset` | Offset of this `Variable` into the full variable, as a list of int. |
| `var_shape` | Shape of this `Variable`, as a list of int. |
| `save_slice_info_def` | `SaveSliceInfoDef` protocol buffer. If not `None`, recreates the SaveSliceInfo object its contents. `save_slice_info_def` and other arguments are mutually exclusive. |
| `import_scope` | Optional `string`. Name scope to add. Only used when initializing from protocol buffer. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `spec` | Computes the spec string used for saving. |

<br />

## Methods

### `from_spec`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/ops/variables.py#L1306-L1372)

    @classmethod
    from_spec(
        spec: str
    ) -> Self

Parses a SaveSliceInfo spec string and returns a SaveSliceInfo object.

<br />

<br />

<br />

| Args ||
|---|---|
| `spec` | The tensor slice spec string according to the SaveSliceInfo.spec property. The spec contains the space-separated shape of the full variable, followed by colon-separated pairs of the variable's offset and shape, where each pair is comma-separated. For example, consider a variable whose full shape is \[4 3 5\], offset is \[0 1 3\], and shape is \[4 1 2\]. This variable's SaveSliceInfo.spec would be "4 3 5 0,4:1,1:3,2". |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A SaveSliceInfo object containing the extracted information. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If the input string is not in the expected format. |

<br />

### `to_proto`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/ops/variables.py#L1374-L1396)

    to_proto(
        export_scope=None
    )

Returns a SaveSliceInfoDef() proto.

<br />

<br />

<br />

| Args ||
|---|---|
| `export_scope` | Optional `string`. Name scope to remove. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A `SaveSliceInfoDef` protocol buffer, or None if the `Variable` is not in the specified name scope. ||

<br />