Skip to content
Merged
24 changes: 24 additions & 0 deletions ci_scripts/hooks/pre-doc-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,27 @@ else
echo "ERROR: Generated API mapping file not found at $GENERATED_FILE"
handle_failure
fi

python "${APIMAPPING_ROOT}/tools/validate_api_difference_format.py"

# 获取上一条命令的退出状态码
exit_code=$?

# 根据退出状态码决定后续操作
if [ $exit_code -eq 0 ]; then
echo "API DIFFERENCE FORMAT VALIDATE SUCCESS!"
# 在这里继续添加您需要执行的命令
else
echo "ERROR: API DIFFERENCE FORMAT VALIDATE FAILURE! error code: $exit_code" >&2
exit 1
fi

python "${APIMAPPING_ROOT}/tools/validate_pytorch_api_mapping.py" --skip-url-check
exit_code=$?

if [ $exit_code -eq 0 ]; then
echo "PYTORCH API MAPPING VALIDATE SUCCESS!"
else
echo "ERROR: PYTORCH API MAPPING VALIDATE FAILURE! error code: $exit_code" >&2
exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ paddle.diagonal(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> A </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| A | x | 表示输入的 Tensor ,仅参数名不一致。 |
| offset | offset | 表示对角线偏移量。 |
| <font color='red'> dim1 </font> | <font color='red'> axis1 </font> | 获取对角线的二维平面的第一维,参数默认值不一致。PyTorch 默认为`-2`,Paddle 默认为`0`,Paddle 需设置为与 PyTorch 一致。 |
| <font color='red'> dim2 </font> | <font color='red'> axis2 </font> | 获取对角线的二维平面的第二维,参数默认值不一致。PyTorch 默认为`-1`,Paddle 默认为`1`,Paddle 需设置为与 PyTorch 一致。 |
| dim1 | axis1 | 获取对角线的二维平面的第一维,参数默认值不一致。PyTorch 默认为`-2`,Paddle 默认为`0`,Paddle 需设置为与 PyTorch 一致。 |
| dim2 | axis2 | 获取对角线的二维平面的第二维,参数默认值不一致。PyTorch 默认为`-1`,Paddle 默认为`1`,Paddle 需设置为与 PyTorch 一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ paddle.Tensor.gcd(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不一致。 |
| other | y | 输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ paddle.Tensor.gcd_(y)

| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不一致。 |
| other | y | 输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ paddle.Tensor.outer(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
|--------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> vec2 </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不一致。 |
| vec2 | y | 输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.nn.functional.hardshrink(x, threshold=0.5, name=None)

| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> lambd </font> | <font color='red'> threshold </font> | Hardshrink 阈值,仅参数名不一致。 |
| lambd | threshold | Hardshrink 阈值,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ paddle.Tensor.heaviside(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> values </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不一致。 |
| values | y | 输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.Tensor.gammainc(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | --------------------------- |
| other | y | 正参数 Tensor,仅参数名不同 |
| other | y | 正参数 Tensor,仅参数名不同 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.Tensor.gammainc_(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | --------------------------- |
| other | y | 正参数 Tensor,仅参数名不同 |
| other | y | 正参数 Tensor,仅参数名不同 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.Tensor.gammaincc(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | --------------------------- |
| other | y | 正参数 Tensor,仅参数名不同 |
| other | y | 正参数 Tensor,仅参数名不同 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.Tensor.gammaincc_(y, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | --------------------------- |
| other | y | 正参数 Tensor,仅参数名不同 |
| other | y | 正参数 Tensor,仅参数名不同 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ paddle.Tensor.index_fill(index, axis, value, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> dim </font> | <font color='red'> axis </font> | 表示进行运算的轴,仅参数名不一致。 |
| <font color='red'> index </font> | <font color='red'> index </font> | 包含索引下标的 1-D Tensor。 |
| <font color='red'> value </font> | <font color='red'> value </font> | 填充的值。 |
| dim | axis | 表示进行运算的轴,仅参数名不一致。 |
| index | index | 包含索引下标的 1-D Tensor。 |
| value | value | 填充的值。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ paddle.Tensor.index_fill_(index, axis, value, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> dim </font> | <font color='red'> axis </font> | 表示进行运算的轴,仅参数名不一致。 |
| <font color='red'> index </font> | <font color='red'> index </font> | 包含索引下标的 1-D Tensor。 |
| <font color='red'> value </font> | <font color='red'> value </font> | 填充的值。 |
| dim | axis | 表示进行运算的轴,仅参数名不一致。 |
| index | index | 包含索引下标的 1-D Tensor。 |
| value | value | 填充的值。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ paddle.Tensor.index_put_(indices, value, accumulate=False)

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> indices </font> | <font color='red'> indices </font> | 包含用来索引的 tensors 的元组。数据类型为 int32,int64,bool。 |
| <font color='red'> values </font> | <font color='red'> value </font> | 用来给 x 赋值的 Tensor,仅参数名不一致。 |
| <font color='red'> accumulate </font> | <font color='red'> accumulate </font> | 指定是否将 value 加到 x 的参数。 默认值为 False。 |
| indices | indices | 包含用来索引的 tensors 的元组。数据类型为 int32,int64,bool。 |
| values | value | 用来给 x 赋值的 Tensor,仅参数名不一致。 |
| accumulate | accumulate | 指定是否将 value 加到 x 的参数。 默认值为 False。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paddle.Tensor.householder_product(tau, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------------------ |
| input2 | tau | 用于计算矩阵乘积,仅参数名不同 |
| input2 | tau | 用于计算矩阵乘积,仅参数名不同 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ paddle.linalg.ormqr(x, tau, y, left=True, transpose=False)

| PyTorch | PaddlePaddle | 备注 |
| --------- | ------------ | ---------------------------------- |
| input2 | tau | Householder 反射系数,仅参数名不同 |
| input3 | y | 用于矩阵乘积,仅参数名不同 |
| left | left | 决定了矩阵乘积运算的顺序 |
| transpose | transpose | 决定矩阵 Q 是否共轭转置变换 |
| input2 | tau | Householder 反射系数,仅参数名不同 |
| input3 | y | 用于矩阵乘积,仅参数名不同 |
| left | left | 决定了矩阵乘积运算的顺序 |
| transpose | transpose | 决定矩阵 Q 是否共轭转置变换 |

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ paddle.cdist(x, y, p=2.0, compute_mode='use_mm_for_euclid_dist_if_necessary', na
| ------------- | ------------ | ------------------------------------------------------ |
| x1 | x | 表示第一个输入的 Tensor ,仅参数名不一致。 |
| x2 | y | 表示第二个输入的 Tensor ,仅参数名不一致。 |
| p | p | 计算每个向量对之间的 p 范数距离的值。默认值为 2.0 |
| p | p | 计算每个向量对之间的 p 范数距离的值。默认值为 2.0 |
| compute_mode | compute_mode |表示计算模式。 |
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ paddle.linalg.cholesky_solve(x, y, upper=False, name=None)

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ---------------------------------------------------------------------------------- |
| input | x | 表示线性方程中的 B 矩阵。仅参数名不一致 |
| input2 | y | 表示线性方程中 A 矩阵的 Cholesky 分解矩阵 u。仅参数名不一致 |
| input | x | 表示线性方程中的 B 矩阵。仅参数名不一致 |
| input2 | y | 表示线性方程中 A 矩阵的 Cholesky 分解矩阵 u。仅参数名不一致 |
| upper | upper | 表示输入 x 是否是上三角矩阵,True 为上三角矩阵,False 为下三角矩阵。|
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ paddle.linalg.corrcoef(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 一个 N(N<=2) 维矩阵,包含多个变量。默认矩阵的每行是一个观测变量,由参数 rowvar 设置。 |
| - | <font color='red'> rowvar </font> | 以行或列作为一个观测变量, PyTorch 无此参数, Paddle 保持默认即可。 |
| input | x | 一个 N(N<=2) 维矩阵,包含多个变量。默认矩阵的每行是一个观测变量,由参数 rowvar 设置。 |
| - | rowvar | 以行或列作为一个观测变量, PyTorch 无此参数, Paddle 保持默认即可。 |

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ paddle.linalg.det(x)

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ paddle.diagflat(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| offset | offset | 表示对角线偏移量。 |
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ paddle.diagonal(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| offset | offset | 表示对角线偏移量。 |
| <font color='red'> dim1 </font> | <font color='red'> axis1 </font> | 获取对角线的二维平面的第一维,仅参数名不一致。 |
| <font color='red'> dim2 </font> | <font color='red'> axis2 </font> | 获取对角线的二维平面的第二维,仅参数名不一致。 |
| dim1 | axis1 | 获取对角线的二维平面的第一维,仅参数名不一致。 |
| dim2 | axis2 | 获取对角线的二维平面的第二维,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ paddle.diagonal_scatter(x,

| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| -------------------------------------------------- |
| <font color='red'> input </font> | <font color='red'> x </font> | 输入张量,被嵌入的张量,仅参数名不一致。 |
| <font color='red'> src </font> | <font color='red'> y </font> | 用于嵌入的张量,仅参数名不一致。 |
| <font color='red'> offset </font> | <font color='red'> offset </font> | 从指定的二维平面嵌入对角线的位置,默认值为 0,即主对角线。 |
| <font color='red'> dim1 </font> | <font color='red'> axis1 </font> | 对角线的第一个维度,默认值为 0,仅参数名不一致。 |
| <font color='red'> dim2 </font> | <font color='red'> axis2 </font> | 对角线的第二个维度,默认值为 1,仅参数名不一致。 |
| input | x | 输入张量,被嵌入的张量,仅参数名不一致。 |
| src | y | 用于嵌入的张量,仅参数名不一致。 |
| offset | offset | 从指定的二维平面嵌入对角线的位置,默认值为 0,即主对角线。 |
| dim1 | axis1 | 对角线的第一个维度,默认值为 0,仅参数名不一致。 |
| dim2 | axis2 | 对角线的第二个维度,默认值为 1,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ paddle.dist(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| <font color='red'> other </font> | <font color='red'> y </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| p | p | 表示需要计算的范数 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
| p | p | 表示需要计算的范数 |
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ paddle.flip(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| <font color='red'> dims </font> | <font color='red'> axis </font> | 表示进行运算的轴,仅参数名不一致。 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| dims | axis | 表示进行运算的轴,仅参数名不一致。 |
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ paddle.isclose(x,

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| <font color='red'> input </font> | <font color='red'> x </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| <font color='red'> other </font> | <font color='red'> y </font> | 表示输入的 Tensor ,仅参数名不一致。 |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
| rtol | rtol | 表示相对容忍误差。 |
| atol | atol | 表示绝对容忍误差。 |
| equal_nan | equal_nan | 表示是否将两个 NaN 数值视为相等。 |
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ paddle.masked_fill(x, mask, value, name=None)
| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------------------- |
| input | x | 输入的 Tensor,仅参数名不一致。 |
| mask | mask | 布尔张量,表示要填充的位置 |
| value | value | 用于填充目标张量的值 |
| mask | mask | 布尔张量,表示要填充的位置 |
| value | value | 用于填充目标张量的值 |
Loading