diff --git a/docs/api/paddle/nn/RNNTLoss_cn.rst b/docs/api/paddle/nn/RNNTLoss_cn.rst index cccc43184c7..d1b5f936c6d 100644 --- a/docs/api/paddle/nn/RNNTLoss_cn.rst +++ b/docs/api/paddle/nn/RNNTLoss_cn.rst @@ -11,7 +11,7 @@ RNNTLoss 参数 ::::::::: - **blank** (int,可选) - 空格标记的 ID 值,其取值范围为 [0, num_classes + 1)。数据类型支持 int32。默认值为 0。 - - **fastemit_lambda** (float,默认 0.001) - FastEmit 的正则化参数(https://arxiv.org/pdf/2010.11148.pdf)。 + - **fastemit_lambda** (float,默认 0.001) - FastEmit 的正则化参数,具体请参考:`FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization `_ 。 - **reduction** (str,可选) - 表示如何平均损失,候选是 ``'none'`` | ``'mean'`` | ``'sum'`` 。如果是 ``'mean'`` ,输出将是损失的总和并除以 batch_size;如果是 ``'sum'``,返回损失的总和;如果为 ``'none'``,则不应用 reduction。默认是 ``'mean'``。 - **name** (str,可选) - 操作名称,默认为 None。 diff --git a/docs/api/paddle/nn/functional/hardswish_cn.rst b/docs/api/paddle/nn/functional/hardswish_cn.rst index 6bb512cc091..e20a201228b 100644 --- a/docs/api/paddle/nn/functional/hardswish_cn.rst +++ b/docs/api/paddle/nn/functional/hardswish_cn.rst @@ -5,7 +5,7 @@ hardswish .. py:function:: paddle.nn.functional.hardswish(x, name=None) -hardswish 激活函数。在 MobileNetV3 架构中被提出,相较于 swish 函数,具有数值稳定性好,计算速度快等优点,具体原理请参考:https://arxiv.org/pdf/1905.02244.pdf +hardswish 激活函数。在 MobileNetV3 架构中被提出,相较于 swish 函数,具有数值稳定性好,计算速度快等优点,具体原理请参考:`Searching for MobileNetV3 `_ 。 .. math:: diff --git a/docs/api/paddle/nn/functional/label_smooth_cn.rst b/docs/api/paddle/nn/functional/label_smooth_cn.rst index bb231d797f8..82a0270608d 100644 --- a/docs/api/paddle/nn/functional/label_smooth_cn.rst +++ b/docs/api/paddle/nn/functional/label_smooth_cn.rst @@ -19,7 +19,7 @@ label_smooth 其中 :math:`1-\epsilon` 和 :math:`\epsilon` 分别是权重,:math:`\tilde{y_k}` 是平滑后的标签,通常 :math:`\mu` 使用均匀分布。 -关于更多标签平滑的细节,`查看论文 `_ 。 +关于更多标签平滑的细节请参考论文:`Rethinking the Inception Architecture for Computer Vision `_ 。 参数 diff --git a/docs/api/paddle/nn/functional/rnnt_loss_cn.rst b/docs/api/paddle/nn/functional/rnnt_loss_cn.rst index 814e369c576..b11e43361bb 100644 --- a/docs/api/paddle/nn/functional/rnnt_loss_cn.rst +++ b/docs/api/paddle/nn/functional/rnnt_loss_cn.rst @@ -15,7 +15,7 @@ rnnt_loss - **input_lengths** (Tensor) - 每个输入序列的长度,它应该有形状 [batch_size] 和 dtype int64。 - **label_lengths** (Tensor) - 每个标签序列的长度,它应该有形状 [batch_size] 和 dtype int64。 - **blank** (int,可选) - RNN-T loss 的空白标签索引,处于半开放区间 [0,B)。数据类型必须为 int32。默认值为 0。 - - **fastemit_lambda** (float,默认 0.001) - FastEmit 的正则化参数(https://arxiv.org/pdf/2010.11148.pdf)。 + - **fastemit_lambda** (float,默认 0.001) - FastEmit 的正则化参数,参考论文:`FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization `_ 。 - **reduction** (str,可选) - 表示如何平均损失,候选是 ``'none'`` | ``'mean'`` | ``'sum'`` 。如果 :attr:`reduction` 是 ``'mean'``,输出将是损失的总和并除以 batch_size;如果 :attr:`reduction` 是 ``'sum'``,返回损失的总和;如果 :attr:`reduction` 为 ``'none'``,则不应用 reduction。默认是 ``'mean'``。 - **name** (str,可选) - 操作名称,默认为 None。 diff --git a/docs/api/paddle/sparse/nn/SubmConv2D_cn.rst b/docs/api/paddle/sparse/nn/SubmConv2D_cn.rst index 1d45083736d..16e96ffe3c3 100644 --- a/docs/api/paddle/sparse/nn/SubmConv2D_cn.rst +++ b/docs/api/paddle/sparse/nn/SubmConv2D_cn.rst @@ -20,7 +20,7 @@ SubmConv2D - :math:`X` : 输入值, NDHWC 格式的 Tencer。 - :math:`W` : 卷积核值, NDHWC 格式的 Tencer。 - - :math:`\\ast` : 子流形卷积运算, 参考论文: https://arxiv.org/abs/1706.01307。 + - :math:`\\ast` : 子流形卷积运算, 参考论文: `Submanifold Sparse Convolutional Networks `_ 。 - :math:`b` : 偏置值, 形状为[M]的 1-D Tencer。 - :math:`Out` : 输出值, :math:`Out` 和 :math:`X` 的形状可能不同。 diff --git a/docs/api/paddle/vision/ops/psroi_pool_cn.rst b/docs/api/paddle/vision/ops/psroi_pool_cn.rst index 476e319d867..79b2443a9ea 100644 --- a/docs/api/paddle/vision/ops/psroi_pool_cn.rst +++ b/docs/api/paddle/vision/ops/psroi_pool_cn.rst @@ -7,7 +7,7 @@ psroi_pool 位置敏感的兴趣区域池化(也称为 PSROIPooling),是在指定输入的感兴趣区域上执行位置敏感的平均池化。它在非均匀大小的输入上执行并获得固定大小的特征图。 -PSROIPooling 由 R-FCN 提出。更多详细信息,请参阅 https://arxiv.org/abs/1605.06409。 +PSROIPooling 由 R-FCN 提出。更多详细信息,请参阅 `R-FCN: Object Detection via Region-based Fully Convolutional Networks `_ 。 参数 ::::::::: diff --git a/docs/api_guides/X2Paddle/Caffe-Fluid.rst b/docs/api_guides/X2Paddle/Caffe-Fluid.rst deleted file mode 100644 index 50619ba15fa..00000000000 --- a/docs/api_guides/X2Paddle/Caffe-Fluid.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. _Caffe-Fluid: - -######################## -Caffe-Fluid 常用层对应表 -######################## - -本文档梳理了 Caffe 常用 Layer 与 PaddlePaddle API 对应关系和差异分析。根据文档对应关系,有 Caffe 使用经验的用户,可根据对应关系,快速熟悉 PaddlePaddle 的接口使用。 - - -.. csv-table:: - :header: "序号", "Caffe Layer", "Fluid 接口", "备注" - :widths: 1, 8, 8, 3 - - "1", "`AbsVal `_", ":ref:`cn_api_fluid_layers_abs`", "功能一致" - "2", "`Accuracy `_", ":ref:`cn_api_fluid_layers_accuracy`", "`差异对比 `_" - "3", "`ArgMax `_", ":ref:`cn_api_fluid_layers_argmax`", "`差异对比 `_" - "4", "`BatchNorm `_", ":ref:`cn_api_fluid_layers_batch_norm`", "`差异对比 `_" - "5", "`BNLL `_", ":ref:`cn_api_fluid_layers_softplus`", "功能一致" - "6", "`Concat `_", ":ref:`cn_api_fluid_layers_concat`", "功能一致" - "7", "`Convolution `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" - "8", "`Crop `_", ":ref:`cn_api_fluid_layers_crop`", "`差异对比 `_" - "9", "`Deconvolution `_", ":ref:`cn_api_fluid_layers_conv2d_transpose`", "`差异对比 `_" - "10", "`Dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "`差异对比 `_" - "11", "`Eltwise `_", "无相应接口", "`Fluid 实现 `_" - "12", "`ELU `_", ":ref:`cn_api_fluid_layers_elu`", "功能一致" - "13", "`EuclideanLoss `_", ":ref:`cn_api_fluid_layers_square_error_cost`", "`差异对比 `_" - "14", "`Exp `_", ":ref:`cn_api_fluid_layers_exp`", "`差异对比 `_" - "15", "`Flatten `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" - "16", "`InnerProduct `_", ":ref:`cn_api_fluid_layers_fc`", "`差异对比 `_" - "17", "`Input `_", ":ref:`cn_api_fluid_layers_data`", "`差异对比 `_" - "18", "`Log `_", ":ref:`cn_api_fluid_layers_log`", "`差异对比 `_" - "19", "`LRN `_", ":ref:`cn_api_fluid_layers_lrn`", "`差异对比 `_" - "20", "`Pooling `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" - "21", "`Power `_", ":ref:`cn_api_fluid_layers_pow`", "`差异对比 `_" - "22", "`PReLU `_", ":ref:`cn_api_fluid_layers_prelu`", "功能一致" - "23", "`Reduction `_", "无相应接口", "`Fluid 实现 `_" - "24", "`ReLU `_", ":ref:`cn_api_fluid_layers_leaky_relu`", "功能一致" - "25", "`Reshape `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" - "26", "`SigmoidCrossEntropyLoss `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "`差异对比 `_" - "27", "`Sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" - "28", "`Slice `_", ":ref:`cn_api_fluid_layers_slice`", "`差异对比 `_" - "29", "`SoftmaxWithLoss `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "`差异对比 `_" - "30", "`Softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "`差异对比 `_" - "31", "`TanH `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" - "32", "`Tile `_", ":ref:`cn_api_fluid_layers_expand`", "`差异对比 `_" diff --git a/docs/api_guides/X2Paddle/TensorFlow-Fluid.rst b/docs/api_guides/X2Paddle/TensorFlow-Fluid.rst deleted file mode 100644 index b3bda4f9fc6..00000000000 --- a/docs/api_guides/X2Paddle/TensorFlow-Fluid.rst +++ /dev/null @@ -1,154 +0,0 @@ -.. _TensorFlow-Fluid: - -############################### -TensorFlow-Fluid 常用接口对应表 -############################### - -本文档基于 TensorFlow v1.13 梳理了常用 API 与 PaddlePaddle API 对应关系和差异分析。根据文档对应关系,有 TensorFlow 使用经验的用户,可根据对应关系,快速熟悉 PaddlePaddle 的接口使用。 - -.. csv-table:: - :header: "序号", "TensorFlow 接口", "Fluid 接口", "备注" - :widths: 1, 8, 8, 3 - - "1", "`tf.abs `_", ":ref:`cn_api_fluid_layers_abs`", "功能一致" - "2", "`tf.add `_", ":ref:`cn_api_fluid_layers_elementwise_add`", "功能一致" - "3", "`tf.argmax `_", ":ref:`cn_api_fluid_layers_argmax`", "功能一致" - "4", "`tf.argmin `_", ":ref:`cn_api_fluid_layers_argmin`", "功能一致" - "5", "`tf.assign `_", ":ref:`cn_api_fluid_layers_assign`", "功能一致" - "6", "`tf.assign_add `_", ":ref:`cn_api_fluid_layers_increment`", "功能一致" - "7", "`tf.case `_", ":ref:`cn_api_fluid_layers_Switch`", "`差异对比 `_" - "8", "`tf.cast `_", ":ref:`cn_api_fluid_layers_cast`", "功能一致" - "9", "`tf.clip_by_global_norm `_", ":ref:`cn_api_fluid_clip_GradientClipByGlobalNorm`", "`差异对比 `_" - "10", "`tf.clip_by_norm `_", ":ref:`cn_api_fluid_layers_clip_by_norm`", "`差异对比 `_" - "11", "`tf.clip_by_value `_", ":ref:`cn_api_fluid_layers_clip`", "功能一致" - "12", "`tf.concat `_", ":ref:`cn_api_fluid_layers_concat`", "功能一致" - "13", "`tf.cond `_", ":ref:`cn_api_fluid_layers_ifElse`", "功能一致" - "14", "`tf.constant `_", ":ref:`cn_api_fluid_layers_fill_constant`", "功能一致" - "15", "`tf.contrib.layers.batch_norm `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" - "16", "`tf.contrib.layers.flatten `_", ":ref:`cn_api_fluid_layers_flatten`", "`差异对比 `_" - "17", "`tf.contrib.layers.fully_connected `_", ":ref:`cn_api_fluid_layers_fc`", "功能一致" - "18", "`tf.contrib.layers.one_hot_encoding `_", ":ref:`cn_api_fluid_layers_one_hot`", "功能一致" - "19", "`tf.contrib.layers.softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "功能一致" - "20", "`tf.contrib.layers.xavier_initializer `_", ":ref:`cn_api_fluid_initializer_Xavier`", "功能一致" - "21", "`tf.nn.rnn.GRUCell `_", ":ref:`cn_api_fluid_layers_gru_unit`", "`差异对比 `_" - "22", "`tf.nn.rnn.MultiRNNCell `_", "无相应接口", "`Fluid 实现 `_" - "23", "`tf.nn.rnn.static_rnn `_", ":ref:`cn_api_fluid_layers_DynamicRNN`", "功能一致" - "24", "`tf.convert_to_tensor `_", ":ref:`cn_api_fluid_layers_assign`", "功能一致" - "25", "`tf.cos `_", ":ref:`cn_api_fluid_layers_cos`", "功能一致" - "26", "`tf.div `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" - "27", "`tf.divide `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" - "28", "`tf.dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "`差异对比 `_" - "29", "`tf.equal `_", "`运算符== `_", "功能一致" - "30", "`tf.exp `_", ":ref:`cn_api_fluid_layers_exp`", "功能一致" - "31", "`tf.expand_dims `_", ":ref:`cn_api_fluid_layers_unsqueeze`", "`差异对比 `_" - "32", "`tf.fill `_", ":ref:`cn_api_fluid_layers_fill_constant`", "功能一致" - "33", "`tf.floor `_", ":ref:`cn_api_fluid_layers_floor`", "功能一致" - "34", "`tf.gather `_", ":ref:`cn_api_fluid_layers_gather`", "功能一致" - "35", "`tf.greater `_", "`运算符> `_", "功能一致" - "36", "`tf.greater_equal `_", "`运算符>= `_", "功能一致" - "37", "`tf.image.non_max_suppression `_", ":ref:`cn_api_fluid_layers_multiclass_nms`", "`差异对比 `_" - "38", "`tf.image.resize_bilinear `_", ":ref:`cn_api_fluid_layers_resize_bilinear`", "功能一致" - "39", "`tf.image.resize_images `_", ":ref:`cn_api_fluid_layers_image_resize`", "`差异对比 `_" - "40", "`tf.image.resize_nearest_neighbor `_", ":ref:`cn_api_fluid_layers_resize_nearest`", "功能一致" - "41", "`tf.is_finite `_", ":ref:`cn_api_fluid_layers_isfinite`", "`差异对比 `_" - "42", "`tf.layers.batch_normalization `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" - "43", "`tf.layers.conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" - "44", "`tf.layers.dense `_", ":ref:`cn_api_fluid_layers_fc`", "`差异对比 `_" - "45", "`tf.layers.dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "功能一致" - "46", "`tf.layers.Dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "功能一致" - "47", "`tf.layers.flatten `_", ":ref:`cn_api_fluid_layers_flatten`", "功能一致" - "48", "`tf.less `_", "`运算符< `_", "功能一致" - "49", "`tf.less_equal `_", "`运算符<= `_", "功能一致" - "50", "`tf.log `_", ":ref:`cn_api_fluid_layers_log`", "功能一致" - "51", "`tf.logical_and `_", ":ref:`cn_api_fluid_layers_logical_and`", "功能一致" - "52", "`tf.logical_not `_", ":ref:`cn_api_fluid_layers_logical_not`", "功能一致" - "53", "`tf.logical_or `_", ":ref:`cn_api_fluid_layers_logical_or`", "功能一致" - "54", "`tf.losses.mean_squared_error `_", ":ref:`cn_api_fluid_layers_square_error_cost`", "`差异对比 `_" - "55", "`tf.losses.sigmoid_cross_entropy `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "`差异对比 `_" - "56", "`tf.losses.softmax_cross_entropy `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "功能一致" - "57", "`tf.matmul `_", ":ref:`cn_api_fluid_layers_matmul`", "`差异对比 `_" - "58", "`tf.maximum `_", ":ref:`cn_api_fluid_layers_elementwise_max`", "功能一致" - "59", "`tf.metrics.accuracy `_", ":ref:`cn_api_fluid_layers_accuracy`", "功能一致" - "60", "`tf.metrics.mean `_", ":ref:`cn_api_fluid_layers_mean`", "功能一致" - "61", "`tf.minimum `_", ":ref:`cn_api_fluid_layers_elementwise_min`", "功能一致" - "62", "`tf.multiply `_", ":ref:`cn_api_fluid_layers_elementwise_mul`", "功能一致" - "63", "`tf.nn.avg_pool `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" - "64", "`tf.nn.batch_normalization `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" - "65", "`tf.nn.bidirectional_dynamic_rnn `_", "无相应接口", "`Fluid 实现 `_" - "66", "`tf.nn.conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" - "67", "`tf.nn.conv2d_transpose `_", ":ref:`cn_api_fluid_layers_conv2d_transpose`", "`差异对比 `_" - "68", "`tf.nn.conv3d_transpose `_", ":ref:`cn_api_fluid_layers_conv3d_transpose`", "`差异对比 `_" - "69", "`tf.nn.depthwise_conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" - "70", "`tf.nn.dynamic_rnn `_", ":ref:`cn_api_fluid_layers_DynamicRNN`", "`差异对比 `_" - "71", "`tf.nn.l2_normalize `_", ":ref:`cn_api_fluid_layers_l2_normalize`", "`差异对比 `_" - "72", "`tf.nn.leaky_relu `_", ":ref:`cn_api_fluid_layers_leaky_relu`", "功能一致" - "73", "`tf.nn.lrn `_", ":ref:`cn_api_fluid_layers_lrn`", "`差异对比 `_" - "74", "`tf.nn.max_pool `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" - "75", "`tf.nn.relu `_", ":ref:`cn_api_fluid_layers_relu`", "功能一致" - "76", "`tf.nn.relu6 `_", ":ref:`cn_api_fluid_layers_relu6`", "功能一致" - "77", "`tf.nn.rnn_cell.LSTMCell `_", ":ref:`cn_api_fluid_layers_lstm_unit`", "`差异对比 `_" - "78", "`tf.nn.separable_conv2d `_", "无相应接口", "`Fluid 实现 `_" - "79", "`tf.nn.sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" - "80", "`tf.nn.sigmoid_cross_entropy_with_logits `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "功能一致" - "81", "`tf.nn.softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "功能一致" - "82", "`tf.nn.softmax_cross_entropy_with_logits `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "`差异对比 `_" - "83", "`tf.nn.softplus `_", ":ref:`cn_api_fluid_layers_softplus`", "功能一致" - "84", "`tf.nn.softsign `_", ":ref:`cn_api_fluid_layers_softsign`", "功能一致" - "85", "`tf.nn.tanh `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" - "86", "`tf.one_hot `_", ":ref:`cn_api_fluid_layers_one_hot`", "`差异对比 `_" - "87", "`tf.ones `_", ":ref:`cn_api_fluid_layers_ones`", "功能一致" - "88", "`tf.intializers.ones `_", ":ref:`cn_api_fluid_initializer_Constant`", "功能一致" - "89", "`tf.pad `_", ":ref:`cn_api_fluid_layers_pad`", "`差异对比 `_" - "90", "`tf.placeholder `_", ":ref:`cn_api_fluid_layers_data`", "`差异对比 `_" - "91", "`tf.pow `_", ":ref:`cn_api_fluid_layers_pow`", "`差异对比 `_" - "92", "`tf.print `_", ":ref:`cn_api_fluid_layers_print`", "`差异对比 `_" - "93", "`tf.py_func `_", ":ref:`cn_api_fluid_layers_py_func`", "功能一致" - "94", "`tf.random_normal `_", ":ref:`cn_api_fluid_layers_gaussian_random`", "功能一致" - "95", "`tf.random_normal_initializer `_", ":ref:`cn_api_fluid_initializer_Normal`", "功能一致" - "96", "`tf.random_uniform `_", ":ref:`cn_api_fluid_layers_uniform_random`", "功能一致" - "97", "`tf.random_uniform_initializer `_", ":ref:`cn_api_fluid_initializer_UniformInitializer`", "功能一致" - "98", "`tf.reduce_logsumexp `_", "无相应接口", "`Fluid 实现 `_" - "99", "`tf.reduce_max `_", ":ref:`cn_api_fluid_layers_reduce_max`", "功能一致" - "100", "`tf.reduce_mean `_", ":ref:`cn_api_fluid_layers_reduce_mean`", "功能一致" - "101", "`tf.reduce_min `_", ":ref:`cn_api_fluid_layers_reduce_min`", "功能一致" - "102", "`tf.reduce_sum `_", ":ref:`cn_api_fluid_layers_reduce_sum`", "功能一致" - "103", "`tf.reshape `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" - "104", "`tf.reverse `_", ":ref:`cn_api_fluid_layers_reverse`", "功能一致" - "105", "`tf.reverse_sequence `_", ":ref:`cn_api_fluid_layers_sequence_reverse`", "`差异对比 `_" - "106", "`tf.reverse_v2 `_", ":ref:`cn_api_fluid_layers_reverse`", "功能一致" - "107", "`tf.round `_", ":ref:`cn_api_fluid_layers_round`", "功能一致" - "108", "`tf.rsqrt `_", ":ref:`cn_api_fluid_layers_rsqrt`", "功能一致" - "109", "`tf.scalar_mul `_", ":ref:`cn_api_fluid_layers_scale`", "功能一致" - "110", "`tf.scatter_update `_", ":ref:`cn_api_fluid_layers_scatter`", "`差异对比 `_" - "111", "`tf.sequence_mask `_", ":ref:`cn_api_fluid_layers_sequence_mask`", "功能一致" - "112", "`tf.shape `_", ":ref:`cn_api_fluid_layers_shape`", "功能一致" - "113", "`tf.sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" - "114", "`tf.sin `_", ":ref:`cn_api_fluid_layers_sin`", "功能一致" - "115", "`tf.slice `_", ":ref:`cn_api_fluid_layers_slice`", "`差异对比 `_" - "116", "`tf.split `_", ":ref:`cn_api_fluid_layers_split`", "`差异对比 `_" - "117", "`tf.sqrt `_", ":ref:`cn_api_fluid_layers_sqrt`", "功能一致" - "118", "`tf.square `_", ":ref:`cn_api_fluid_layers_square`", "功能一致" - "119", "`tf.squared_difference `_", "无相应接口", "`Fluid 实现 `_" - "120", "`tf.squeeze `_", ":ref:`cn_api_fluid_layers_squeeze`", "功能一致" - "121", "`tf.stack `_", ":ref:`cn_api_fluid_layers_stack`", "功能一致" - "122", "`tf.stop_gradient `_", "无相应接口", "`Fluid 实现 `_" - "123", "`tf.subtract `_", ":ref:`cn_api_fluid_layers_elementwise_sub`", "功能一致" - "124", "`tf.tanh `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" - "125", "`tf.tile `_", ":ref:`cn_api_fluid_layers_expand`", "功能一致" - "126", "`tf.top_k `_", ":ref:`cn_api_fluid_layers_topk`", "`差异对比 `_" - "127", "`tf.train.AdagradOptimizer `_", ":ref:`cn_api_fluid_optimizer_AdagradOptimizer`", "功能一致" - "128", "`tf.train.AdamOptimizer `_", ":ref:`cn_api_fluid_optimizer_Adam`", "功能一致" - "129", "`tf.train.exponential_decay `_", ":ref:`cn_api_fluid_layers_exponential_decay`", "功能一致" - "130", "`tf.train.GradientDescentOptimizer `_", ":ref:`cn_api_fluid_optimizer_SGDOptimizer`", "功能一致" - "131", "`tf.train.MomentumOptimizer `_", ":ref:`cn_api_fluid_optimizer_MomentumOptimizer`", "功能一致" - "132", "`tf.train.polynomial_decay `_", ":ref:`cn_api_fluid_layers_polynomial_decay`", "功能一致" - "133", "`tf.train.RMSPropOptimizer `_", ":ref:`cn_api_fluid_optimizer_RMSPropOptimizer`", "功能一致" - "134", "`tf.transpose `_", ":ref:`cn_api_fluid_layers_transpose`", "功能一致" - "135", "`tf.truediv `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" - "136", "`tf.truncated_normal `_", ":ref:`cn_api_fluid_initializer_TruncatedNormal`", "功能一致" - "137", "`tf.truncated_normal_initializer `_", ":ref:`cn_api_fluid_initializer_TruncatedNormal`", "功能一致" - "138", "`tf.unstack `_", ":ref:`cn_api_fluid_layers_unstack`", "功能一致" - "139", "`tf.Variable `_", ":ref:`cn_api_fluid_layers_create_parameter`", "功能一致" - "140", "`tf.while_loop `_", ":ref:`cn_api_fluid_layers_While`", "`差异对比 `_" - "141", "`tf.zeros `_", ":ref:`cn_api_fluid_layers_zeros`", "功能一致" - "142", "`tf.zeros_initializer `_", ":ref:`cn_api_fluid_initializer_Constant`", "功能一致" diff --git a/docs/design/concepts/python_data_feeding.md b/docs/design/concepts/python_data_feeding.md index a4b9391496e..921ddcc7ebb 100644 --- a/docs/design/concepts/python_data_feeding.md +++ b/docs/design/concepts/python_data_feeding.md @@ -2,7 +2,7 @@ In the former implementation of Paddle Fluid, there are two ways to feed data: -- Use `reader_op` in backend C++ side. This method only supports data feeding from recordio files and random data generators, but supports many kinds of `decorated_readers`. For examples, `double_buffer_reader` uses two threads to achieve better performance: one for time-consuming I/O operations, and the other for `Executor::Run()`. See [C++ Data Feeding](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/design/concepts/cpp_data_feeding.md) for details. +- Use `reader_op` in backend C++ side. This method only supports data feeding from recordio files and random data generators, but supports many kinds of `decorated_readers`. For examples, `double_buffer_reader` uses two threads to achieve better performance: one for time-consuming I/O operations, and the other for `Executor::Run()`. See [C++ Data Feeding](https://github.com/PaddlePaddle/docs/blob/develop/docs/design/concepts/cpp_data_feeding.md) for details. - Feed data directly using `DataFeeder.feed()` in Python codes. It is more flexible than the first way. Many kinds of preprocessing steps can be performed before feeding using Python or any other languages, instead of adding many uncommon `operators` in C++ side. But this method is less efficient: the program cannot read the next mini-batch data before `Executor::Run()` ends. Moreover, `decorated_readers` such as `double_buffer_reader` cannot be used for better performance. diff --git a/docs/design/concurrent/channel.md b/docs/design/concurrent/channel.md index db2a1737103..97235d66fa7 100644 --- a/docs/design/concurrent/channel.md +++ b/docs/design/concurrent/channel.md @@ -103,9 +103,9 @@ current thread under two conditions: 2. The channel is unbuffered and does not have a receiver - **recvq**: This queue holds the QueueMessage of any pending receivers of a -channel. When a thread performs a channel_recv operation on the channel, the -channel_recv operation will put a new QueueMessage on the recvq and block the -current thread under two conditions: + channel. When a thread performs a channel_recv operation on the channel, the + channel_recv operation will put a new QueueMessage on the recvq and block the + current thread under two conditions: 1. The channel is buffered and there is no data on the buff_ 2. The channel is unbuffered and does not have a sender @@ -114,15 +114,17 @@ current thread under two conditions: #### Channel Send

-
+

+ #### Channel Receive

-
+

+ ## Limitations and Considerations ### Variable Copy diff --git a/docs/design/concurrent/select_op.md b/docs/design/concurrent/select_op.md index da561dfd5b6..1aef49b883c 100644 --- a/docs/design/concurrent/select_op.md +++ b/docs/design/concurrent/select_op.md @@ -254,9 +254,10 @@ only one case will be executed. ### select_op flow

-
+

+ The select algorithm is inspired by golang's select routine. Please refer to http://www.tapirgames.com/blog/golang-concurrent-select-implementation for more information. diff --git a/docs/dev_guides/sugon/paddle_c86_cn.md b/docs/dev_guides/sugon/paddle_c86_cn.md index cc93ac6d665..80d11e1ff72 100644 --- a/docs/dev_guides/sugon/paddle_c86_cn.md +++ b/docs/dev_guides/sugon/paddle_c86_cn.md @@ -13,7 +13,7 @@ ROCm 软件栈整体架构如下,其中除了支持 C86 加速卡 的 Driver/F - HIPCC:HIP Kernel 编译器,类同于 NVCC 编译器,支持将 CUDA Kernel 或者 HIP Kernel 编译为 ROCm 上的可执行程序 - 加速库、数学库及通讯库:包括 MIOpen,rocBLAS,RCCL 等,分别对标 CUDA 的 cuDNN,cuBLAS, NCCL 等 ([对照表](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md#library-equivalents)) -ROCm 软件栈本身具备较高的成熟度与完备性,用户根据 ROCm 提供的 CUDA 到 HIP 的[代码移植手册](https://rocmdocs.amd.com/en/latest/Programming_Guides/HIP-porting-guide.html) ,可以较为方便的将 CUDA 上的工作移植到 HIP 上,使得用户程序可以支持跨 ROCm 与 CUDA 的异构计算。 +ROCm 软件栈本身具备较高的成熟度与完备性,用户根据 ROCm 提供的 CUDA 到 HIP 的[代码移植手册](https://rocm.docs.amd.com/projects/HIP/en/docs-5.7.1/user_guide/hip_porting_guide.html) ,可以较为方便的将 CUDA 上的工作移植到 HIP 上,使得用户程序可以支持跨 ROCm 与 CUDA 的异构计算。 ![图片](../images/sugon_rocm.png) @@ -30,16 +30,16 @@ ROCm 软件栈本身具备较高的成熟度与完备性,用户根据 ROCm 提 - [operators.cmake](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/operators.cmake#L98) 配置 HIP Kernel 算子注册方式,自动映射 CUDA Kernel 算子文件为 HIP Kernel 算子文件 - 其他相关 cmake 配置,包括依赖的第三方库如 [eigen.cmake](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/external/eigen.cmake) 和 [warpctc.cmake](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/external/warpctc.cmake)等 2. 设备接入:主要包括设备相关的 Driver/Runtime API 的接入,以及通讯库等底层加速库的接入工作 - - 动态库加载: 在 [paddle/fluid/platform/dynload](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform/dynload) 目录下动态加载 ROCm 加速库及所需 API,如 [hiprand.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/dynload/hiprand.h) [miopen.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/dynload/miopen.h) [rocblas.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/dynload/rocblas.h)等 - - Driver/Runtime 适配:主要在 [paddle/fluid/platform/device/gpu](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform/device/gpu) 目录下对 HIP 和 CUDA 进行了相关 API 的封装,其中在 [gpu_types.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/device/gpu/gpu_types.h) 少量封装了部分与 CUDA 差异较小的数据类型定义,部分 ROCm 独有代码位于[paddle/fluid/platform/device/gpu/rocm](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform/device/gpu/rocm)目录 - - Memory 管理:利用上一步封装好的 Driver/Runtime API 对 [memcpy.cc](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/memory/memcpy.cc#L574) 与 [paddle/fluid/memory/allocation](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/memory/allocation) 目录下的多种 Memory Allocator 进行实现 - - Device Context 管理:利用封装好的 API 实现对设备上下文的管理及设备池的初始化,位于 [device_contxt.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/device_context.h) + - 动态库加载: 在 [paddle/phi/backends/dynload](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/backends/dynload) 目录下动态加载 ROCm 加速库及所需 API,如 [hiprand.h](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/backends/dynload/hiprand.h) [miopen.h](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/backends/dynload/miopen.h) [rocblas.h](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/backends/dynload/rocblas.h)等 + - Driver/Runtime 适配:主要在 [paddle/fluid/platform/device/gpu](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform/device/gpu) 目录下对 HIP 和 CUDA 进行了相关 API 的封装,其中在 [gpu_types.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/core/platform/device/gpu/gpu_types.h) 少量封装了部分与 CUDA 差异较小的数据类型定义,部分 ROCm 独有代码位于[paddle/phi/core/platform/device/gpu/rocm](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/core/platform/device/gpu/rocm)目录 + - Memory 管理:利用上一步封装好的 Driver/Runtime API 对 [memcpy.cc](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/core/memory/memcpy.cc#L574) 与 [paddle/phi/core/memory/allocation](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/phi/core/memory/allocation) 目录下的多种 Memory Allocator 进行实现 + - Device Context 管理:利用封装好的 API 实现对设备上下文的管理及设备池的初始化,位于 [device_contxt.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/core/platform/device_context.h) - 其他设备管理相关的适配接入,如 Profiler, Tracer, Error Message, NCCL 等,代码主要位于 [Paddle/platform](https://github.com/PaddlePaddle/Paddle/tree/develop/paddle/fluid/platform) 目录下 3. 算子注册:主要包括 HIP Kernel 的算子注册,以及 MIOpen 的算子在 ROCm 平台上的注册 - - 数据类型支持:除通用数据类型外,还需适配 Paddle 支持的特殊数据类型包括 [float16.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/float16.h#L144) [complex.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/complex.h#L88) [bfloat16.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/platform/bfloat16.h#L65) 等 + - 数据类型支持:除通用数据类型外,还需适配 Paddle 支持的特殊数据类型包括 [float16.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/common/float16.h#L144) [complex.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/common/complex.h#L88) [bfloat16.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/common/bfloat16.h#L65) 等 - 数学库支持:通过 ROCm 的 rocBLAS 库,实现 Paddle 在 [blas.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/funcs/blas/blas.h) 中定义的 BLAS 函数,代码位于 [blas_impl.hip.h](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/funcs/blas/blas_impl.hip.h) - Kernel 算子注册:根据 [operators.cmake](https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/operators.cmake#L98) 的修改,可以大部分复用 Paddle 框架下的 CUDA 已有算子 Kernel 文件,存在部分 Kernel 实现在 CUDA 与 ROCm 平台下有所区别,例如线程数、WarpSize 以及 thurst 库等;此类区别需要针对具体的算子实现进行相应的调整,通过 Paddle 自身的算子单测用例以及模型验证测试可以对此类问题进行定位并修复 - - MIOpen 算子注册:MIOpen 与 cuDNN 的接口与类型设计较为类似,但在实际执行中还是存在一定区别,因为对于此类算子需根据 MIOpen API 进行适配,甚至对于差异较大的算子例如 [rnn_op.cu.cc](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/operators/rnn_op.cu.cc#L506) 需要进行 weight 数据重排 + - MIOpen 算子注册:MIOpen 与 cuDNN 的接口与类型设计较为类似,但在实际执行中还是存在一定区别,因为对于此类算子需根据 MIOpen API 进行适配,甚至对于差异较大的算子例如 [rnn_op.cu.cc](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/inference/tensorrt/convert/rnn_op.cc) 需要进行 weight 数据重排 4. Python API 兼容适配:当前 Paddle ROCm 兼容所有 Paddle CUDA 相关的 Python API,这意味着对于所有目前 Paddle 可以支持 CUDA 的模型,无需修改任意代码可以直接运行在 C86 加速卡 上 经过以上几个步骤的适配工作,用户可以无需修改任意代码就将之前在 Paddle CUDA 平台上的程序运行在 C86 加速卡 的环境下,在保持用户已有的基于 Paddle CUDA 的编程习惯的同时,也减少了 Paddle 已有的模型套件在 CUDA 平台与 ROCm 平台之间的迁移工作。 diff --git a/docs/guides/beginner/tensor_cn.md b/docs/guides/beginner/tensor_cn.md index 60e7cfb43e2..8a7dd23563e 100644 --- a/docs/guides/beginner/tensor_cn.md +++ b/docs/guides/beginner/tensor_cn.md @@ -120,7 +120,7 @@ Tensor(shape=[2, 2, 5], dtype=int64, place=Place(gpu:0), stop_gradient=True, 上述不同维度的 Tensor 可视化的表示如下图所示: -
+

图 1 不同维度的 Tensor 可视化表示
需要注意的是,Tensor 必须形如矩形,即在任何一个维度上,元素的数量必须相等,否则会抛出异常,示例如下: @@ -270,7 +270,7 @@ ndim_4_Tensor = paddle.ones([2, 3, 4, 5]) ``` -
+

图 2 Tensor 的 shape、axis、dimension、ndim 之间的关系
```python @@ -649,7 +649,7 @@ print(z.shape) ``` -
+

图 3 Tensor 广播示例
## 六、Tensor 与 Numpy 数组相互转换 diff --git a/docs/guides/beginner/tensor_en.md b/docs/guides/beginner/tensor_en.md index f894a55a191..e9c1a09e14f 100644 --- a/docs/guides/beginner/tensor_en.md +++ b/docs/guides/beginner/tensor_en.md @@ -68,7 +68,7 @@ Tensor(shape=[2, 2, 5], dtype=int64, place=Place(gpu:0), stop_gradient=True, ``` The visual representation of the **Tensor* above is: -
+

Figure1. Visual representation of Tensor with different dimensions
**Tensor** must be "rectangular" -- that is, along each dimension, the number of elements must be equal. For example: @@ -127,7 +127,7 @@ Create a 4-D **Tensor**, and visualize it to represents the relationship between ndim_4_tensor = paddle.ones([2, 3, 4, 5]) ``` -
+

Figure2. The relationship between Tensor shape, axis, dimension and ndim
```python