压缩

Squeeze - 23

版本

  • 名称: Squeeze (GitHub)

  • 域名: main

  • since_version: 23

  • 函数: False

  • support_level: SupportType.COMMON

  • 形状推断: True

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

摘要

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

输入

在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

  • support_level: 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

  • since_version: 13

  • 函数: False

  • support_level: 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

  • since_version: 11

  • 函数: False

  • support_level: 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

  • since_version: 1

  • 函数: False

  • support_level: 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) ):

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