Wang Yi

Results 41 issues of Wang Yi

Reproduce: press v and select somewhere ![20201223160147](https://user-images.githubusercontent.com/53533850/102973695-31262280-4538-11eb-95f1-90649210a2d3.png) press d and find the cursor position remains unchanged ![20201223160401](https://user-images.githubusercontent.com/53533850/102973872-82361680-4538-11eb-872a-bfc0bc8178f3.png)

https://github.com/yl-1993/learn-to-cluster/blob/3b834589923baf72523e288cc462e0df591b99c1/utils/adjacency.py#L20-L24 The original adjacency matrix built from faiss is not symmetric, so what is the purpose to convert it to symmetric matrix? And why do you implement it in this...

背景:https://github.com/Oneflow-Inc/OneCloud/issues/70#issuecomment-1077397584 概述:module 的 `load_state_dict` 报错信息不太友好,并且没有检查 checkpoint 和 model 参数的 `is_global` 是否匹配,导致用户的 global model 加载 local state_dict 时,报错会被后面的 try except 捕捉到,返回一些无法提炼重要信息的错误内容 ![image](https://user-images.githubusercontent.com/53533850/183797605-094bd360-23da-4e29-bf71-b48bf285a4fc.png) 实现:在 module.py 的 `load_state_dict` 遍历加载参数时,增加了两者间 `is_global` 是否匹配的检查,防止在后面的 try except...

enhancement
documentation
python

背景:https://github.com/Oneflow-Inc/oneflow/issues/8841 问题概述:缺少 `pairwise_distance` 算子 实现:Functor 层调用 `norm(x1 - x2, p=p)` torch实现:https://github.com/pytorch/pytorch/blob/6a09847c42bf7d33ba0aea5b083eebd846661ce1/aten/src/ATen/native/Distance.cpp#L16-L23

背景:https://github.com/Oneflow-Inc/OneTeam/issues/1600 此PR完成了: - 增加了 `clamp_min` , `clamp_max` , `clamp_min_` , `clamp_max_` 接口并增加了相应的文档和单元测试 实现方式:全部都在 functor 层调用 `ClampBaseFunctor` 实现 文档截图: 此外,发现 clamp 系列存在两个问题,需要之后修复: - 不支持 out 参数 - min / max 不支持...

enhancement
automerge
api
python

背景:https://github.com/Oneflow-Inc/OneTeam/issues/1519 概述:缺少 `column_stack` api 实现:本PR实现了以下接口及其单测、文档 - column_stack - row_stack - vstack - hstack - dstack - atleast_1d - atleast_2d - atleast_3d 文档: (atleast_1d example最下面的 >>> 已经改掉了) ![image](https://user-images.githubusercontent.com/53533850/184089296-b8a16961-64a7-4d10-8ff6-45e043744525.png) ![image](https://user-images.githubusercontent.com/53533850/184089485-d6474fd9-1e48-4862-b412-8c0aeacccb29.png) ![image](https://user-images.githubusercontent.com/53533850/184089605-e12414a5-95b2-4f93-ae52-196a7d811a95.png) ![image](https://user-images.githubusercontent.com/53533850/184089736-2b7ad266-5c92-4c3f-8a76-fd5e4e0c3462.png)...

enhancement
documentation
api
python

背景:https://github.com/Oneflow-Inc/OneCloud/issues/136#issuecomment-1194951405 问题概述:cosine_similarity 中,当两个输入的 dims 不同时,会报错。 PR的实现: 在cosine_similarity的实现中,当两个输入的shape不同时,会遍历两个shape,来生成一个max_shape,然后将两个输入都expand成该max_shape再进行后续计算。这里遍历的时候,下标写错了,导致访问越界。 torch的实现: cosine_similarity的处理: https://github.com/pytorch/pytorch/blob/62c8d30f9f6715d0b60d78fb5f5913a2f3bd185b/aten/src/ATen/native/Distance.cpp#L275-L280 生成max_shape的处理: https://github.com/pytorch/pytorch/blob/62c8d30f9f6715d0b60d78fb5f5913a2f3bd185b/aten/src/ATen/ExpandUtils.cpp#L17-L43

enhancement
automerge
bug
op

背景:https://github.com/Oneflow-Inc/OneCloud/issues/104#issuecomment-1156122806 概述:oneflow的ctc_loss不接受int64的target输入而torch能 实现: - ctc_loss共有四个输入参数,除log_prob之外,其余都是整数形式。实现过程中发现torch支持三个整数参数 int32/64 任意类型的组合,而oneflow只能同时为int64或int32。故增加了两个模板参数,和torch的接口对齐。 文档: ![image](https://user-images.githubusercontent.com/53533850/186389076-7d150fea-7bda-4e93-967e-204d9df9583d.png) ![image](https://user-images.githubusercontent.com/53533850/186389137-6253b503-7298-468d-ab34-7fa75aa94973.png)

enhancement
api

单测代码还有bug,暂不要review

此PR完成了: - 搬运了 python 中的 tensor api 到 Python C api - 确定了用 CPython api 重写 tensor api 的规则,即“**只手写 Python 逻辑,不手写参数解析逻辑**“。按照这个规则,删掉了原来比较复杂的手写的 tensor api ,将其挪到了对应的宏中 一些零碎的改动: - std 和 var 两个函数,修改了...

enhancement
api
python