Unsqueeze¶
Unsqueeze - 23¶
版本¶
域:
main
起始版本:
23
函数:
False
支持级别:
SupportType.COMMON
形状推断:
True
该版本的算子自版本 23起可用。
概要¶
在输入张量 (data
) 的形状中插入单维条目。接受一个必需的输入 axes
- 其中包含一个维度索引列表,该算子将在输出张量 (expanded
) 的相应索引处插入一个值为 1
的维度。
例如,给定形状为 [3, 4, 5] 的输入张量 (data
),则 Unsqueeze(data, axes=[0, 4]) 输出一个张量 (expanded
),其包含与 data
相同的数据,但形状为 [1, 3, 4, 5, 1]。
输入 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¶
版本¶
域:
main
起始版本:
21
函数:
False
支持级别:
SupportType.COMMON
形状推断:
True
该版本的算子自版本 21起可用。
概要¶
在输入张量 (data
) 的形状中插入单维条目。接受一个必需的输入 axes
- 其中包含一个维度索引列表,该算子将在输出张量 (expanded
) 的相应索引处插入一个值为 1
的维度。
例如,给定形状为 [3, 4, 5] 的输入张量 (data
),则 Unsqueeze(data, axes=[0, 4]) 输出一个张量 (expanded
),其包含与 data
相同的数据,但形状为 [1, 3, 4, 5, 1]。
输入 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¶
版本¶
域:
main
起始版本:
13
函数:
False
支持级别:
SupportType.COMMON
形状推断:
True
该版本的算子自版本 13起可用。
概要¶
在输入张量 (data
) 的形状中插入单维条目。接受一个必需的输入 axes
- 其中包含一个维度索引列表,该算子将在输出张量 (expanded
) 的相应索引处插入一个值为 1
的维度。
例如,给定形状为 [3, 4, 5] 的输入张量 (data
),则 Unsqueeze(data, axes=[0, 4]) 输出一个张量 (expanded
),其包含与 data
相同的数据,但形状为 [1, 3, 4, 5, 1]。
输入 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¶
版本¶
域:
main
起始版本:
11
函数:
False
支持级别:
SupportType.COMMON
形状推断:
True
该版本的算子自版本 11起可用。
概要¶
在输入张量 (data
) 的形状中插入单维条目。接受一个必需的参数 axes
- 其中包含一个维度索引列表,该算子将在输出张量 (expanded
) 的相应索引处插入一个值为 1
的维度。
例如:给定形状为 [3, 4, 5] 的输入张量 (data
),则 Unsqueeze(data, axes=[0, 4]) 输出一个张量 (expanded
),其包含与 data
相同的数据,但形状为 [1, 3, 4, 5, 1]。
属性 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¶
版本¶
域:
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)
)将输入和输出类型约束为所有张量类型。