形状

形状 - 23

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 23

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 23 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。可选属性 start 和 end 可用于计算输入张量形状的切片。如果省略 start 轴,切片从轴 0 开始。end 轴(如果指定)是排他的(返回的值将不包括该轴的大小)。如果省略 end 轴,则将包含直到(包括)最后一个轴的所有轴的大小。负轴表示从最后一个轴向后计数维度。请注意,如果轴超出范围(对于负轴的情况,在加上 r 后),它们将被限制在 [0, r-1] 的范围内,其中 r 是输入张量的秩。因此,指定任何大于 r 的 end 值等同于指定 end 值为 r,指定任何小于 -r 的 start 值等同于指定 start 值为 0。

示例

Input tensor with shape: [2, 3, 4]
No attributes specified.
Output: [2, 3, 4]
Input tensor with shape: [2, 3, 4]
start: -1
Output: [4]
Input tensor with shape: [2, 3, 4]
end: -1
Output: [2, 3]
Input tensor with shape: [2, 3, 4]
start: 1
end: 2
Output: [3]

属性

  • end - INT :

    (可选) 用于切片形状的结束轴。负值表示从后向前计数维度。如果省略,将包含直到(包括)最后一个轴的所有轴的大小。

  • start - INT (默认值为 '0')

    (可选) 用于切片形状的起始轴。默认值为 0。负值表示从后向前计数维度。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

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

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。

形状 - 21

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 21

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 21 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。可选属性 start 和 end 可用于计算输入张量形状的切片。如果省略 start 轴,切片从轴 0 开始。end 轴(如果指定)是排他的(返回的值将不包括该轴的大小)。如果省略 end 轴,则将包含直到(包括)最后一个轴的所有轴的大小。负轴表示从最后一个轴向后计数维度。请注意,如果轴超出范围(对于负轴的情况,在加上 r 后),它们将被限制在 [0, r-1] 的范围内,其中 r 是输入张量的秩。因此,指定任何大于 r 的 end 值等同于指定 end 值为 r,指定任何小于 -r 的 start 值等同于指定 start 值为 0。

示例

Input tensor with shape: [2, 3, 4]
No attributes specified.
Output: [2, 3, 4]
Input tensor with shape: [2, 3, 4]
start: -1
Output: [4]
Input tensor with shape: [2, 3, 4]
end: -1
Output: [2, 3]
Input tensor with shape: [2, 3, 4]
start: 1
end: 2
Output: [3]

属性

  • end - INT :

    (可选) 用于切片形状的结束轴。负值表示从后向前计数维度。如果省略,将包含直到(包括)最后一个轴的所有轴的大小。

  • start - INT (默认值为 '0')

    (可选) 用于切片形状的起始轴。默认值为 0。负值表示从后向前计数维度。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

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

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。

形状 - 19

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 19

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 19 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。可选属性 start 和 end 可用于计算输入张量形状的切片。如果省略 start 轴,切片从轴 0 开始。end 轴(如果指定)是排他的(返回的值将不包括该轴的大小)。如果省略 end 轴,则将包含直到(包括)最后一个轴的所有轴的大小。负轴表示从最后一个轴向后计数维度。请注意,如果轴超出范围(对于负轴的情况,在加上 r 后),它们将被限制在 [0, r-1] 的范围内,其中 r 是输入张量的秩。因此,指定任何大于 r 的 end 值等同于指定 end 值为 r,指定任何小于 -r 的 start 值等同于指定 start 值为 0。

示例

Input tensor with shape: [2, 3, 4]
No attributes specified.
Output: [2, 3, 4]
Input tensor with shape: [2, 3, 4]
start: -1
Output: [4]
Input tensor with shape: [2, 3, 4]
end: -1
Output: [2, 3]
Input tensor with shape: [2, 3, 4]
start: 1
end: 2
Output: [3]

属性

  • end - INT :

    (可选) 用于切片形状的结束轴。负值表示从后向前计数维度。如果省略,将包含直到(包括)最后一个轴的所有轴的大小。

  • start - INT (默认值为 '0')

    (可选) 用于切片形状的起始轴。默认值为 0。负值表示从后向前计数维度。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

  • 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(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) )

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。

形状 - 15

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 15

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 15 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。可选属性 start 和 end 可用于计算输入张量形状的切片。如果省略 start 轴,切片从轴 0 开始。end 轴(如果指定)是排他的(返回的值将不包括该轴的大小)。如果省略 end 轴,则将包含直到(包括)最后一个轴的所有轴的大小。负轴表示从最后一个轴向后计数维度。请注意,如果轴超出范围(对于负轴的情况,在加上 r 后),它们将被限制在 [0, r-1] 的范围内,其中 r 是输入张量的秩。因此,指定任何大于 r 的 end 值等同于指定 end 值为 r,指定任何小于 -r 的 start 值等同于指定 start 值为 0。

示例

Input tensor with shape: [2, 3, 4]
No attributes specified.
Output: [2, 3, 4]
Input tensor with shape: [2, 3, 4]
start: -1
Output: [4]
Input tensor with shape: [2, 3, 4]
end: -1
Output: [2, 3]
Input tensor with shape: [2, 3, 4]
start: 1
end: 2
Output: [3]

属性

  • end - INT :

    (可选) 用于切片形状的结束轴。负值表示从后向前计数维度。如果省略,将包含直到(包括)最后一个轴的所有轴的大小。

  • start - INT (默认值为 '0')

    (可选) 用于切片形状的起始轴。默认值为 0。负值表示从后向前计数维度。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

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

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。

形状 - 13

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 13

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 13 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

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

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。

形状 - 1

版本

  • 名称: Shape (GitHub)

  • : main

  • 起始版本: 1

  • 函数: False

  • 支持级别: SupportType.COMMON

  • 形状推断: True

此版本的算子自版本 1 起可用。

摘要

接受一个张量作为输入,并输出一个包含输入张量形状的 1D int64 张量。

输入

  • data (异构) - T

    一个输入张量。

输出

  • shape (异构) - T1

    输入张量的形状

类型约束

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

    输入张量可以是任意类型。

  • T1 in ( tensor(int64) )

    将输出约束为 int64 张量。