From a818a6e4da5658f98b06443b41a6726abcb0c842 Mon Sep 17 00:00:00 2001 From: LiuChiaChi <709153940@qq.com> Date: Fri, 18 Sep 2020 06:07:16 +0000 Subject: [PATCH] fix example code for Model, test=document_fix, notest --- python/paddle/hapi/model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index 3bcc62e423b..82ae908e2b1 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -969,6 +969,7 @@ class Model(object): import numpy as np import paddle import paddle.nn as nn + from paddle.static import InputSpec device = paddle.set_device('cpu') # or 'gpu' paddle.disable_static(device) @@ -1093,6 +1094,7 @@ class Model(object): import paddle import paddle.nn as nn + from paddle.static import InputSpec device = paddle.set_device('cpu') paddle.disable_static(device) @@ -1170,6 +1172,7 @@ class Model(object): import paddle import paddle.nn as nn + from paddle.static import InputSpec paddle.disable_static() -- GitLab