未验证 提交 323160df 编写于 作者: C Chen Long 提交者: GitHub

fix code example bugs;test=document_fix (#43905)

上级 6d31dc93
......@@ -855,15 +855,14 @@ def read_file(filename, name=None):
import cv2
import paddle
fake_img = (np.random.random(
(400, 300, 3)) * 255).astype('uint8')
fake_img = (paddle.rand((400, 300, 3)).numpy() * 255).astype('uint8')
cv2.imwrite('fake.jpg', fake_img)
img_bytes = paddle.vision.ops.read_file('fake.jpg')
print(img_bytes.shape)
# [142915]
"""
if _non_static_mode():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册