分割成序列

SplitToSequence - 11

版本

  • 名称: SplitToSequence (GitHub)

  • 域名: main

  • since_version: 11

  • 函数: False

  • support_level: SupportType.COMMON

  • 形状推断: True

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

摘要

沿着指定的‘axis’将一个张量分割成一系列张量。 可以使用可选参数‘split’来指定各部分的长度。 如果未指定参数split' is not specified, a default scalar value of 1 is used as the value of split’。 ‘split’必须只包含正数。 ‘split’可以是一个标量(空形状的张量)或一维张量。 如果‘split’是一个标量,则‘input’将被分割成大小为‘split’的块, 如果可能的话。如果‘input’在给定轴‘axis’上的大小不能被‘split’整除,则最后一块可能小于‘split’。 如果‘split’是一维张量,则输入张量将被分割成‘size(split)’块, 各部分的长度在‘split’中指定。在这种情况下,‘split’中的条目总和必须等于输入张量在‘axis’上的维度大小。

属性

  • axis - INT (默认为 '0'):

    在哪个轴上分割。负值表示从后向前计算维度。可接受的范围是[-rank, rank-1]。

  • keepdims - INT (默认为 '1'):

    是否保留分割维度。默认为1,表示我们保留分割维度。如果指定了输入‘split’,则忽略此属性。

输入

在1和2个输入之间。

  • 输入 (异构) - T:

    要分割的张量

  • split (可选, 异构) - I:

    每个输出的长度。它可以是一个标量(空形状的张量),或者是一个一维张量。所有值必须大于或等于0。

输出

  • output_sequence (异构) - S:

    一个或多个输出在分割后形成一系列张量

类型约束

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

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

  • I 在 ( tensor(int32), tensor(int64) ) 中:

    将分割大小限制为整数张量。

  • S 在 ( seq(tensor(bool)), seq(tensor(complex128)), seq(tensor(complex64)), seq(tensor(double)), seq(tensor(float)), seq(tensor(float16)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(int8)), seq(tensor(string)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(uint8)) ):

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