Skip to content

Commit 117a5cb

Browse files
committed
fix some bug
1 parent 9ae9773 commit 117a5cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/paddle/nn/functional/input.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ def one_hot(x, num_classes, name=None):
7373
.. code-block:: python
7474
7575
import paddle
76-
import paddle.fluid as fluid
7776
# Correspond to the first example above, where label.shape is 4 and one_hot_label.shape is [4, 4].
78-
label = fluid.data(name="label", shape=[4, 1], dtype="int64")
77+
label = paddle.data(name="label", shape=[4, 1], dtype="int64")
7978
# label.shape = [4]
8079
# label.data = [1, 1, 3, 0]
8180
one_hot_label = paddle.nn.functional.one_hot(x=label, num_classes=4)

0 commit comments

Comments
 (0)