MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TEST

Function TEST

test/cpp/inference/api/trt_disable_tensorrt_half_ops_test.cc:20–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace inference {
19
20TEST(TensorRT, disable_tensorrt_half_ops) {
21 std::string model_dir = FLAGS_infer_model + "/resnet50";
22 AnalysisConfig config;
23 config.SetModel(model_dir);
24 config.EnableUseGpu(100, 0);
25 config.EnableTensorRtEngine(
26 1 << 30, 1, 5, AnalysisConfig::Precision::kHalf, false, false);
27
28 paddle_infer::experimental::InternalUtils::DisableTensorRtHalfOps(&config,
29 {"conv2d"});
30
31 std::vector<std::vector<PaddleTensor>> inputs_all;
32 auto predictor = CreatePaddlePredictor(config);
33 SetFakeImageInput(&inputs_all, model_dir, false, "__model__", "");
34
35 std::vector<PaddleTensor> outputs;
36 for (auto &input : inputs_all) {
37 ASSERT_TRUE(predictor->Run(input, &outputs));
38 predictor->ClearIntermediateTensor();
39 }
40}
41
42} // namespace inference
43} // namespace paddle

Callers

nothing calls this directly

Calls 6

SetFakeImageInputFunction · 0.85
SetModelMethod · 0.45
EnableUseGpuMethod · 0.45
EnableTensorRtEngineMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected