PaddlePaddle / docs

Documentations for PaddlePaddle
https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/index_cn.html
Apache License 2.0
238 stars 701 forks source link

【映射文档】添加 api 别名表格 #6672

Closed RedContritio closed 2 months ago

RedContritio commented 2 months ago

在映射主目录中添加 api 别名表格

该表格为静态数据,数据依赖 PaConvert,更新时需要手动更新

paddle-bot[bot] commented 2 months ago

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6672.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html 预览工具的更多说明,请参考:飞桨文档预览工具

zhwesky2010 commented 2 months ago

在映射主目录中添加 api 别名表格

该表格为静态数据,数据依赖 PaConvert,更新时需要手动更新

  • 表格更新方法

    1. 将 PaConvert 的 api_alias_mapping.json 文件复制到 validate_mapping_in_api_difference.py 所在目录中
    2. 执行 validate_mapping_in_api_difference.py,基于 json 生成 pytorch_api_mapping_cn.tmp.md 文件
    3. pytorch_api_mapping_cn.tmp.md 找到对应的 ## alias 部分,复制表格到 pytorch_api_mapping_cn.md 中,完成更新。
  • 缺失 API:别名和本名都不存在文档的 API

    Alias Warning: api torch.Tensor.atan2_ have no mapping doc, failed to reference from alias torch.Tensor.arctan2_ Alias Warning: api torch.amp.autocast_mode.autocast have no mapping doc, failed to reference from alias torch.amp.autocast Alias Warning: api torch.celu_ have no mapping doc, failed to reference from alias torch.nn.functional.celu_ Alias Warning: api torch.channel_shuffle have no mapping doc, failed to reference from alias torch.nn.functional.channel_shuffle Alias Warning: api torch.conv_tbc have no mapping doc, failed to reference from alias torch.nn.functional.conv_tbc Alias Warning: api torch.distributions.binomial.Binomial have no mapping doc, failed to reference from alias torch.distributions.Binomial Alias Warning: api torch.distributions.continuous_bernoulli.ContinuousBernoulli have no mapping doc, failed to reference from alias torch.distributions.ContinuousBernoulli Alias Warning: api torch.distributions.exponential.Exponential have no mapping doc, failed to reference from alias torch.distributions.Exponential Alias Warning: api torch.distributions.multivariate_normal.MultivariateNormal have no mapping doc, failed to reference from alias torch.distributions.MultivariateNormal Alias Warning: api torch.distributions.one_hot_categorical.OneHotCategorical have no mapping doc, failed to reference from alias torch.distributions.OneHotCategorical Alias Warning: api torch.distributions.transforms.CatTransform have no mapping doc, failed to reference from alias torch.distributions.CatTransform Alias Warning: api torch.distributions.transforms.CumulativeDistributionTransform have no mapping doc, failed to reference from alias torch.distributions.CumulativeDistributionTransform Alias Warning: api torch.distributions.transforms.SoftplusTransform have no mapping doc, failed to reference from alias torch.distributions.SoftplusTransform Alias Warning: api torch.igamma have no mapping doc, failed to reference from alias torch.special.gammainc Alias Warning: api torch.igammac have no mapping doc, failed to reference from alias torch.special.gammaincc Alias Warning: api torch.nn.modules.Linear have no mapping doc, failed to reference from alias torch.nn.linear Alias Warning: api torch.nn.modules.RNNCellBase have no mapping doc, failed to reference from alias torch.nn.RNNCellBase Alias Warning: api torch.nn.modules.linear.Linear have no mapping doc, failed to reference from alias torch.nn.linear Alias Warning: api torch.nn.modules.rnn.RNNCellBase have no mapping doc, failed to reference from alias torch.nn.RNNCellBase Alias Warning: api torch.nn.parameter.UninitializedParameter have no mapping doc, failed to reference from alias torch.nn.UninitializedParameter Alias Warning: api torch.selu_ have no mapping doc, failed to reference from alias torch.nn.functional.selu_ Alias Warning: api torch.threshold_ have no mapping doc, failed to reference from alias torch.nn.functional.threshold_ Alias Warning: api torch.torch.int32 have no mapping doc, failed to reference from alias torch.int32 Alias Warning: api transformers.generation.logits_process.LogitsProcessorList have no mapping doc, failed to reference from alias transformers.generation.LogitsProcessorList Alias Warning: api transformers.modeling_utils.PreTrainedModel have no mapping doc, failed to reference from alias transformers.PreTrainedModel Alias Warning: api transformers.utils.logging.get_logger have no mapping doc, failed to reference from alias transformers.logging.get_logger

这个torch.nn.linear,在PaConvert中写错了,所以没匹配上。其他的都需要补充映射文档,除了 transformers.* 系列的API,其他的根据Matcher你这边补充一下文档吧:缺失API映射文档补充这一块工作,可能还缺少较多其他的要一起做(凡是有Matcher都需要有文档)

RedContritio commented 2 months ago

这个torch.nn.linear,在PaConvert中写错了,所以没匹配上。其他的都需要补充映射文档,除了 transformers.* 系列的API,其他的根据Matcher你这边补充一下文档吧:缺失API映射文档补充这一块工作,可能还缺少较多其他的要一起做(凡是有Matcher都需要有文档)

这部分改动比较大,准备等先合入了再追加补充,避免和其他 PR 冲突。 torch.nn.Linear 已更新。