Unsqueeze¶
Unsqueeze - 23¶
版本¶
領域:
main
since_version:
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 in (
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
since_version:
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 in (
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
since_version:
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
since_version:
11
函數:
False
支援等級:
SupportType.COMMON
形狀推斷:
True
此版本的運算符自第 11 版起可用。
摘要¶
在輸入張量 ( data
) 的形狀中插入單一維度的條目。 需要一個必要的參數 axes
- 其中包含維度索引的列表,並且此運算符將在輸出張量 ( expanded
) 的對應索引中插入值為 1
的維度。
例如:給定一個形狀為 [3, 4, 5] 的輸入張量 ( data
),則 Unsqueeze(data, axes=[0, 4]) 會輸出一個包含與 data
相同數據的張量 ( expanded
),但形狀為 [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
since_version:
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)
)將輸入和輸出類型限制為所有張量類型。