:nosearch: .. _op_ai_onnx_Unsqueeze-11: Unsqueeze - version 11 ====================== This page documents version **11** of operator **Unsqueeze**. See :doc:`Unsqueeze` for the latest version (since version 25). - **Domain**: ``ai.onnx`` - **Since version**: 11 Insert single-dimensional entries to the shape of an input tensor (``data``). Takes one required argument ``axes`` - which contains a list of dimension indices and this operator will insert a dimension of value ``1`` into the corresponding index of the output tensor (``expanded``). For example: .. code-block:: text Given an input tensor (`data`) of shape [3, 4, 5], then Unsqueeze(data, axes=[0, 4]) outputs a tensor (`expanded`) containing the same data as `data` but with shape [1, 3, 4, 5, 1]. The attribute ``axes`` should not contain any duplicate entries. It is an error if it contains duplicates. The rank of the output tensor (``output_rank``) is the rank of the input tensor (``data``) plus the number of values in ``axes``. Each value in ``axes`` should be within the (inclusive) range [-output_rank , output_rank - 1]. The order of values in ``axes`` does not matter and can come in any order. **Inputs** - **data** (*T*): Original tensor **Outputs** - **expanded** (*T*): Reshaped tensor with same data as input. **Attributes** - **axes** (*int[]*): List of integers indicating the dimensions to be inserted. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(expanded). **Type Constraints** - **T**: Constrain input and output types to all tensor types. Allowed types: tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8). Differences with previous version (1) ------------------------------------- **SchemaDiff**: ``Unsqueeze`` (domain ``'ai.onnx'``) * old version: 1 * new version: 11 * breaking: no