Skip to content

Commit

Permalink
remove dy2static test_lac predictor run case (PaddlePaddle#27844)
Browse files Browse the repository at this point in the history
* remove test_lac predictor run case
  • Loading branch information
OliverLPH authored Oct 13, 2020
1 parent c5f2802 commit af57537
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions python/paddle/fluid/tests/unittests/dygraph_to_static/test_lac.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
from paddle.fluid.dygraph import declarative, ProgramTranslator
from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX

from predictor_utils import PredictorTools

SEED = 2020

program_translator = ProgramTranslator()
Expand Down Expand Up @@ -540,18 +538,13 @@ def verify_predict(self):
dy_pre = self.predict_dygraph(batch)
st_pre = self.predict_static(batch)
dy_jit_pre = self.predict_dygraph_jit(batch)
predictor_pre = self.predict_analysis_inference(batch)
self.assertTrue(
np.allclose(dy_pre, st_pre),
msg="dy_pre:\n {}\n, st_pre: \n{}.".format(dy_pre, st_pre))
self.assertTrue(
np.allclose(dy_jit_pre, st_pre),
msg="dy_jit_pre:\n {}\n, st_pre: \n{}.".format(dy_jit_pre,
st_pre))
self.assertTrue(
np.allclose(predictor_pre, st_pre),
msg="predictor_pre:\n {}\n, st_pre: \n{}.".format(predictor_pre,
st_pre))

def predict_dygraph(self, batch):
words, targets, length = batch
Expand Down Expand Up @@ -602,15 +595,6 @@ def predict_dygraph_jit(self, batch):

return pred_res.numpy()

def predict_analysis_inference(self, batch):
words, targets, length = batch

output = PredictorTools(self.args.model_save_dir,
self.args.model_filename,
self.args.params_filename, [words, length])
out = output()
return out


if __name__ == "__main__":
unittest.main()

0 comments on commit af57537

Please sign in to comment.