Unsqueeze

Unsqueeze - 25

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • since_version: 25

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

摘要

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的输入 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如,给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

输入 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

输入

  • data (异构) - T

    原始张量

  • axes(异构) - tensor(int64)

    指示要插入的维度的整数一维张量。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输出

  • expanded(异构) - 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 及之前的所有张量类型。

Unsqueeze - 24

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • 起始版本24

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

摘要

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的输入 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如,给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

输入 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

输入

  • data (异构) - T

    原始张量

  • axes(异构) - tensor(int64)

    指示要插入的维度的整数一维张量。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输出

  • expanded(异构) - 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 及以前的所有张量类型。

Unsqueeze - 23

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • 起始版本23

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

摘要

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的输入 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如,给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

输入 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

输入

  • data (异构) - T

    原始张量

  • axes(异构) - tensor(int64)

    指示要插入的维度的整数一维张量。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输出

  • expanded(异构) - 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 及以前的所有张量类型。

Unsqueeze - 21

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • since_version: 21

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

总结

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的输入 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如,给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

输入 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

输入

  • data (异构) - T

    原始张量

  • axes(异构) - tensor(int64)

    指示要插入的维度的整数列表。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输出

  • expanded(异构) - 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 及以前的所有张量类型。

Unsqueeze - 13

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • 起始版本: 13

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

总结

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的输入 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如,给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

输入 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

输入

  • data (异构) - T

    原始张量

  • axes(异构) - tensor(int64)

    指示要插入的维度的整数列表。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输出

  • expanded(异构) - 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) )

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

Unsqueeze - 11

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • 起始版本: 11

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

摘要

向输入张量 (data) 的形状中插入单维条目。它接受一个必需的参数 axes,其中包含维度索引列表,此操作符将在输出张量 (expanded) 的相应索引处插入一个值为 1 的维度。

例如:给定形状为 [3, 4, 5] 的输入张量 (data),则 Unsqueeze(data, axes=[0, 4]) 输出一个与 data 包含相同数据但形状为 [1, 3, 4, 5, 1] 的张量 (expanded)。

属性 axes 不应包含任何重复条目。如果包含重复条目,则会出错。输出张量 (output_rank) 的秩是输入张量 (data) 的秩加上 axes 中的值数量。 axes 中的每个值都应在(包含)范围 [-output_rank , output_rank - 1] 内。 axes 中值的顺序无关紧要,可以以任何顺序出现。

属性

  • axes - INTS(必需)

    指示要插入的维度的整数列表。负值表示从后往前计数维度。接受的范围是 [-r, r-1],其中 r = rank(expanded)。

输入

  • data (异构) - T

    原始张量

输出

  • expanded(异构) - 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) )

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

Unsqueeze - 1

版本

  • 名称: Unsqueeze (GitHub)

  • : main

  • 起始版本: 1

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

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

摘要

向张量的形状中插入单维条目。它接受一个必需的参数 axes,这是一个要插入的维度列表。axes 中的维度索引是输出张量中的维度索引。例如:给定一个形状为 [3, 4, 5] 的张量,则 Unsqueeze(tensor, axes=[0, 4]) 的形状为 [1, 3, 4, 5, 1]

属性

  • axes - INTS(必需)

    非负整数列表,指示要插入的维度

输入

  • data (异构) - T

    原始张量

输出

  • expanded(异构) - 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) )

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