Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
新增Bucketizev2算子,对标PyTorch的torch.bucketize功能,用于将连续数值映射到离散区间
>>> boundaries = torch.tensor([0, 10, 100], dtype=torch.float32) >>> input = torch.tensor([[-5, 10000], [150, 10], [5, 100]], dtype=torch.float32) >>> output = torch.bucketize(input, boundaries) >>> output tensor([[0, 3], [3, 2], [1, 3]])
图灵设计团队
推荐网络有用到此算子,当前使用AICPU实现,整网占比8%
全载模板:boundary常驻UB,每次查询无需重复搬运, 使用simd二分查找 级联查找模板:对boundary进行采样,采样的边界放入UB,先用采样边界进行粗粒度二分查找,确定大致区间,再在细分区间内进行精确二分查找
/assign
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
新增Bucketizev2算子,对标PyTorch的torch.bucketize功能,用于将连续数值映射到离散区间
Origin(信息来源)
图灵设计团队
Benefit / Necessity (价值/作用)
推荐网络有用到此算子,当前使用AICPU实现,整网占比8%
Design(设计方案)
全载模板:boundary常驻UB,每次查询无需重复搬运, 使用simd二分查找
级联查找模板:对boundary进行采样,采样的边界放入UB,先用采样边界进行粗粒度二分查找,确定大致区间,再在细分区间内进行精确二分查找