Skip to content

Commit

Permalink
【Hackathon 5th No.35】为 Paddle 新增 histogramdd API(update) (#753)
Browse files Browse the repository at this point in the history
* add copysign rfc

* fix input args, add backward kernel, fix python api

* fix types

* fix Number types

* add pdist api design

* fix typo

* fix

* add bitwise_shift rfc

* update

* add bitwise rfc

* update

* update jax shift doc

* add histogramdd rfc

* add some detail

* add test path, fix args desc

* modify params in api: sample to x, range to rangs.
  • Loading branch information
cocoshe authored Dec 5, 2023
1 parent 91a82e2 commit c4ac7f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rfcs/APIs/20231001_api_design_for_histogramdd.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,14 @@ PyTorch底层用cpp实现kernel,Numpy通过API在Python层直接实现。

API的设计为:

- paddle.histogramdd(sample, bins, range=None, density=False, weights=None,name=None)
- paddle.histogramdd(x, bins, ranges=None, density=False, weights=None,name=None)

其中

+ sample(Tensor) - 输入的多维 tensor
+ x(Tensor) - 输入的多维 tensor
+ bins(Tensor[], int[], int) 若为`Tensor[]`,则定义了bin的边缘序列;若为`int[]`,则每个值分别定义了每个维度的等宽bin的数量;若为`int`,则定义了所有维度的等宽bin的数量。
+ range(*sequence of python:float*):规定了bin的最左端和最右端,也就是范围。若为None则以所有输入的最小值和最大值作为边界。
+ ranges(*sequence of python:float*):规定了bin的最左端和最右端,也就是范围。若为None则以所有输入的最小值和最大值作为边界。

+ density (bool) – 默认为 False , 结果将包含每个bin中的计数。如果设置为 True ,则每个计数(重量)将除以总计数,然后除以其所在bin的范围宽度。
+ weight(Tensor): 默认所有输入权重为1,他的shape必须与输入sample除去最内部维度的shape相同,例如当sample的shape为[M,N]时,weight的shape必须为[M]
+ name(str, 可选)- 操作的名称(默认值为None)。
Expand Down

0 comments on commit c4ac7f9

Please sign in to comment.