diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 61f14395b917cef6b563d5314c969f9a4bfee0ff..85e0afb270ffcba260851c58d18153d499e6827a 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -10676,7 +10676,10 @@ def npair_loss(anchor, positive, labels, l2_reg=0.002): Examples: .. code-block:: python - npair_loss = fluid.layers.npair_loss(anchor, positive, labels, l2_reg) + anchor = fluid.layers.data(name='anchor', shape=[18,6], dtype='float32') + positive = fluid.layers.data(name='positive', shape=[18,6], dtype='float32') + label = fluid.layers.data(name='labels',shape=[18], dtype='float32') + npair_loss = fluid.layers.npair_loss(anchor, positive, labels, 0.002) ''' Beta = 0.25 batch_size = labels.shape[0]