# tfg.geometry.convolution.graph_pooling.unpool

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/geometry/convolution/graph_pooling.py#L119-L185) |

Graph upsampling by inverting the pooling map.

    tfg.geometry.convolution.graph_pooling.unpool(
        data: type_alias.TensorLike,
        pool_map: type_alias.TensorLike,
        sizes: type_alias.TensorLike,
        name: str = 'graph_pooling_unpool'
    ) -> tf.Tensor

Upsamples a graph by applying a pooling map in reverse. The inputs `pool_map`
and `sizes` are the same as used for pooling:

    pooled = pool(data, pool_map, sizes)
    upsampled = unpool(pooled, pool_map, sizes)

The shorthands used below are
`V1`: The number of vertices in the input data.
`V2`: The number of vertices in the unpooled output data.
`C`: The number of channels in the data.

<br />

<br />

<br />

| ## Note ||
|---|---|
| In the following, A1 to A3 are optional batch dimensions. Only up to three batch dimensions are supported due to limitations with TensorFlow's dense-sparse multiplication. ||

<br />

Please see the documentation for [`graph_pooling.pool`](https://www.tensorflow.org/graphics/api_docs/python/tfg/geometry/convolution/graph_pooling/pool) for a detailed
interpretation of the inputs `pool_map` and `sizes`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `data` | A `float` tensor with shape `[A1, ..., A3, V1, C]`. |
| `pool_map` | A `SparseTensor` with the same type as `data` and with shape `[A1, ..., A3, V1, V2]`. The features for vertex [`v1`](https://www.tensorflow.org/api_docs/python/tf/compat/v1) are computed by pooling over the entries in `pool_map[A1, ..., A3, v1, :]`. This function applies this pooling map in reverse. |
| `sizes` | An `int` tensor of shape `[A1, ..., A3, 2]` indicating the true input sizes in case of padding (`sizes=None` indicates no padding): `sizes[A1, ..., A3, 0] <= V1` and `sizes[A1, ..., A3, 1] <= V2`. |
| `name` | A name for this op. Defaults to 'graph_pooling_unpool'. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Tensor with shape `[A1, ..., A3, V2, C]`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if the input types are invalid. |
| `ValueError` | if the input dimensions are invalid. |

<br />