将输入 Tensor 沿着水平轴分割成多个子 Tensor。当 x 的维度大于 1 时等价于将 cn_api_paddle_tensor_split
API 的参数 axis 固定为 1,当 x 的维度等于 1 时等价于将 paddle.tensor_split API 的参数 axis 固定为 0。
- x (Tensor) - 输入变量,数据类型为 bool、bfloat16、float16、float32、float64、uint8、int8、int32、int64 的多维 Tensor,其维度必须大于 0。
- num_or_indices (inttuple) - 如果
num_or_indices
是一个整数n
,则x
拆分为n
部分。如果num_or_indices
是整数索引的列表或元组,则在每个索引处分割x
。- name (str,可选) - 具体用法请参见
api_guide_Name
,一般无需设置,默认值为 None。
list[Tensor],分割后的 Tensor 列表。
COPY-FROM: paddle.hsplit