:nosearch: .. _op_ai_onnx_Shape-23: Shape - version 23 ================== This page documents version **23** of operator **Shape**. See :doc:`Shape` for the latest version (since version 25). - **Domain**: ``ai.onnx`` - **Since version**: 23 Takes a tensor as input and outputs an 1D int64 tensor containing the shape of the input tensor. Optional attributes start and end can be used to compute a slice of the input tensor's shape. If start axis is omitted, the slice starts from axis 0. The end axis, if specified, is exclusive (and the returned value will not include the size of that axis). If the end axis is omitted, the axes upto the last one will be included. Negative axes indicate counting back from the last axis. Note that axes will be clamped to the range [0, r], where r is the rank of the input tensor if they are out-of-range (after adding r in the case of negative axis). Thus, specifying any end value > r is equivalent to specifying an end value of r, and specifying any start value end, the result will be an empty shape. Examples: .. code-block:: Input tensor with shape: [2, 3, 4] No attributes specified. Output: [2, 3, 4] .. code-block:: Input tensor with shape: [2, 3, 4] start: -1 Output: [4] .. code-block:: Input tensor with shape: [2, 3, 4] end: -1 Output: [2, 3] .. code-block:: Input tensor with shape: [2, 3, 4] start: 1 end: 2 Output: [3] **Inputs** - **data** (*T*): An input tensor. **Outputs** - **shape** (*T1*): Shape of the input tensor **Attributes** - **end** (*int*): (Optional) Ending axis for slicing the shape. Negative value means counting dimensions from the back. If omitted, sizes of all axes upto (including) the last one will be included. - **start** (*int*): (Optional) Starting axis for slicing the shape. Default value is 0.Negative value means counting dimensions from the back. **Type Constraints** - **T**: Input tensor can be of arbitrary type. Allowed types: tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(float4e2m1), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8). - **T1**: Constrain output to int64 tensor. Allowed types: tensor(int64). Differences with previous version (21) -------------------------------------- **SchemaDiff**: ``Shape`` (domain ``'ai.onnx'``) * old version: 21 * new version: 23 * breaking: no **Type constraints:** * changed 'T': added types: ['tensor(float4e2m1)']