Skip to content

Conversation

@xgqdut2016
Copy link
Collaborator

No description provided.

@xgqdut2016 xgqdut2016 added 模块:算子 添加新的算子 类别:重构 项目结构、接口更改、或重命名 进度:已完成 开发完成,等待审阅合并 labels Oct 31, 2024
@PanZezhong1725 PanZezhong1725 added 类别:优化 功能强化、性能提升 and removed 类别:重构 项目结构、接口更改、或重命名 labels Nov 12, 2024
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from bb29825 to c4bddda Compare November 20, 2024 03:04
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from d453160 to ad66af0 Compare December 10, 2024 02:05
@xgqdut2016 xgqdut2016 force-pushed the random_sample_workspace branch from 85e1629 to 8068970 Compare December 18, 2024 06:55
int voc;
DT rDtype;
int rLength;
int step;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

指针偏移请使用size_t, 命名使用offset一类。其余使用int的地方都需要修改,根据情况使用uint64或int64


def random_sample(data, random_val, topp, topk, voc, temperature, torch_device):
indices = torch.zeros([topk], dtype = torch.int64)
if(torch_device == "cuda"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以均使用int64临时替代,不用再判断cuda了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

模块:算子 添加新的算子 类别:优化 功能强化、性能提升 进度:已完成 开发完成,等待审阅合并

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants