Squeeze

Squeeze - 25

版本

  • 名称: Squeeze (GitHub)

  • : main

  • since_version: 25

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已在版本 25 及之后可用。

摘要

从张量的形状中移除单维度条目。接受一个输入 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

输入

1 到 2 个输入之间。

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

  • axes (可选,异构) - tensor(int64)

    表示要压缩的维度的整数一维张量。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型约束

  • T 在 ( 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(float8e8m0), tensor(int16), tensor(int2), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint2), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    将输入和输出类型限制为 IRv13 及之前的所有张量类型。

Squeeze - 24

版本

  • 名称: Squeeze (GitHub)

  • : main

  • 起始版本24

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已可用于版本 24 及以上

摘要

从张量的形状中移除单维度条目。接受一个输入 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

输入

1 到 2 个输入之间。

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

  • axes (可选,异构) - tensor(int64)

    表示要压缩的维度的整数一维张量。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型约束

  • T 在 ( 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(float8e8m0), tensor(int16), tensor(int32), tensor(int4), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint4), tensor(uint64), tensor(uint8) )

    将输入和输出类型限制为 IRv12 及以前的所有张量类型。

Squeeze - 23

版本

  • 名称: Squeeze (GitHub)

  • : main

  • 起始版本23

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符已可用于版本 23 及以上

摘要

从张量的形状中移除单维度条目。接受一个输入 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

输入

1 到 2 个输入之间。

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

  • axes (可选,异构) - tensor(int64)

    表示要压缩的维度的整数一维张量。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型约束

  • T 在 ( 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) )

    将输入和输出类型限制为 IRv11 及以前的所有张量类型。

Squeeze - 21

版本

  • 名称: Squeeze (GitHub)

  • : main

  • since_version: 21

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的操作符自 版本 21 起可用。

总结

从张量的形状中移除单维度条目。接受一个输入 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

输入

1 到 2 个输入之间。

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

  • axes (可选,异构) - tensor(int64)

    表示要压缩的维度列表的整数。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型约束

  • T 在 ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), 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) )

    将输入和输出类型限制为 IRv10 及以前的所有张量类型。

Squeeze - 13

版本

  • 名称: Squeeze (GitHub)

  • : main

  • 起始版本: 13

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符自 版本 13 起可用。

总结

从张量的形状中移除单维度条目。接受一个输入 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

输入

1 到 2 个输入之间。

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

  • axes (可选,异构) - tensor(int64)

    表示要压缩的维度列表的整数。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型限制

  • T 在 ( tensor(bfloat16), 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) )

    将输入和输出类型限制为所有张量类型。

Squeeze - 11

版本

  • 名称: Squeeze (GitHub)

  • : main

  • 起始版本: 11

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符自 版本 11 起可用。

摘要

从张量的形状中移除单维度条目。接受一个参数 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

属性

  • axes - INTS :

    表示要压缩的维度列表的整数。负值表示从后面开始计数维度。接受范围是 [-r, r-1],其中 r = rank(data)。

输入

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型限制

  • T 在 ( 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) )

    将输入和输出类型限制为所有张量类型。

Squeeze - 1

版本

  • 名称: Squeeze (GitHub)

  • : main

  • 起始版本: 1

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的运算符自 版本 1 起可用。

摘要

从张量的形状中移除单维度条目。接受一个参数 axes,其中包含要压缩的轴列表。如果未提供 axes,则将从形状中移除所有单维度。如果所选轴的形状条目不等于一,则会引发错误。

属性

  • axes - INTS :

    非负整数列表,表示要压缩的维度。

输入

  • data (异构) - T

    具有至少 max(dims) 维度的张量。

输出

  • 压缩后的 (异构) - T

    与输入具有相同数据的重塑张量。

类型约束

  • T 在 ( 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) )

    将输入和输出类型限制为所有张量类型。