"Run inference on all ranks with arbitrary arguments");
.def("state_dict",[](InferEngine&self){
// Return a dictionary containing references to the whole state of the module.
autostate_dict=self.state_dict();
py::dictresult;
for(constauto&[name,param]:state_dict){
result[py::cast(name)]=infinicore::Tensor(param);
}
returnresult;
})
.def("generate",[](InferEngine&self,py::objectinput_ids,py::objectposition_ids)->infinicore::Tensor{returnself.generate(input_ids.cast<infinicore::Tensor>(),position_ids.cast<infinicore::Tensor>());},"Run inference on all ranks with arbitrary arguments");