MCPcopy Index your code
hub / github.com/AgentMaker/PaddleQuickInference / eval

Method eval

ppqi/inference.py:104–129  ·  view source on GitHub ↗

create the model predictor by model config

(self)

Source from the content-addressed store, hash-verified

102
103 # 预测器创建函数
104 def eval(self):
105 '''
106 create the model predictor by model config
107 '''
108 # 创建预测器
109 self.predictor = create_predictor(self.config)
110
111 # 获取模型的输入输出名称
112 self.input_names = self.predictor.get_input_names()
113 self.output_names = self.predictor.get_output_names()
114
115 # 获取模型的输入输出节点数量
116 self.input_num = len(self.input_names)
117 self.output_num = len(self.output_names)
118
119 # 获取输入
120 self.input_handles = []
121 for input_name in self.input_names:
122 self.input_handles.append(
123 self.predictor.get_input_handle(input_name))
124
125 # 获取输出
126 self.output_handles = []
127 for output_name in self.output_names:
128 self.output_handles.append(
129 self.predictor.get_output_handle(output_name))
130
131 # 前向计算函数
132 def forward(self, *input_datas, batch_size=1):

Callers 8

main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80
main.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected