# pypto.bitwise_right_shift【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto产品支持情况产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练系列产品/Atlas A3 推理系列产品√Atlas A2 训练系列产品/Atlas A2 推理系列产品√功能说明逐元素地将input右移other位。计算公式如下$$ res_i input_i other_i $$函数原型bitwise_right_shift(input: Union[Tensor, int], other: Union[Tensor, int]) - Tensor参数说明参数名输入/输出说明input输入源操作数。支持的类型为为int以及Tensor类型。Tensor支持的数据类型为DT_INT16。不支持空TensorShape仅支持1-4维支持按照单个维度广播到相同形状Shape Size不大于2147483647即INT32_MAX。other输入源操作数。支持的类型为int以及Tensor类型。Tensor支持的数据类型为DT_INT16。不支持空TensorShape仅支持1-4维支持按照单个维度广播到相同形状Shape Size不大于2147483647即INT32_MAX。返回值说明返回输出TensorTensor的数据类型和input、other相同Shape为input和other广播后大小。约束说明input 和 other 类型应该相同。调用示例TileShape设置示例调用该operation接口前应通过set_vec_tile_shapes设置TileShape。TileShape维度应和输出一致。如非广播场景输入input shape为[m, n]other为[m, n]输出为[m, n]TileShape设置为[m1, n1]则m1, n1分别用于切分m, n轴。广播场景输入input shape为[m, n]other为[m, 1]输出为[m, n]TileShape设置为[m1, n1]则m1, n1分别用于切分m, n轴。pypto.set_vec_tile_shapes(4, 16)接口调用示例a pypto.tensor([1, 3], pypto.DT_INT16) b pypto.tensor([1, 3], pypto.DT_INT16) out pypto.bitwise_right_shift(a, b)结果示例如下Input a: [[1 2 3]] Input b: [[1 1 1]] Output out: [[0 1 1]]【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
CANN/pypto按位右移操作
发布时间:2026/5/22 4:34:04
# pypto.bitwise_right_shift【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto产品支持情况产品是否支持Ascend 950PR/Ascend 950DT√Atlas A3 训练系列产品/Atlas A3 推理系列产品√Atlas A2 训练系列产品/Atlas A2 推理系列产品√功能说明逐元素地将input右移other位。计算公式如下$$ res_i input_i other_i $$函数原型bitwise_right_shift(input: Union[Tensor, int], other: Union[Tensor, int]) - Tensor参数说明参数名输入/输出说明input输入源操作数。支持的类型为为int以及Tensor类型。Tensor支持的数据类型为DT_INT16。不支持空TensorShape仅支持1-4维支持按照单个维度广播到相同形状Shape Size不大于2147483647即INT32_MAX。other输入源操作数。支持的类型为int以及Tensor类型。Tensor支持的数据类型为DT_INT16。不支持空TensorShape仅支持1-4维支持按照单个维度广播到相同形状Shape Size不大于2147483647即INT32_MAX。返回值说明返回输出TensorTensor的数据类型和input、other相同Shape为input和other广播后大小。约束说明input 和 other 类型应该相同。调用示例TileShape设置示例调用该operation接口前应通过set_vec_tile_shapes设置TileShape。TileShape维度应和输出一致。如非广播场景输入input shape为[m, n]other为[m, n]输出为[m, n]TileShape设置为[m1, n1]则m1, n1分别用于切分m, n轴。广播场景输入input shape为[m, n]other为[m, 1]输出为[m, n]TileShape设置为[m1, n1]则m1, n1分别用于切分m, n轴。pypto.set_vec_tile_shapes(4, 16)接口调用示例a pypto.tensor([1, 3], pypto.DT_INT16) b pypto.tensor([1, 3], pypto.DT_INT16) out pypto.bitwise_right_shift(a, b)结果示例如下Input a: [[1 2 3]] Input b: [[1 1 1]] Output out: [[0 1 1]]【免费下载链接】pyptoPyPTO发音: pai p-t-oParallel Tensor/Tile Operation编程范式。项目地址: https://gitcode.com/cann/pypto创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考