// TFLoadAndPredict generates PAI-TF prediction program.
TFLoadAndPredict generates PAI-TF prediction program.
// TFLoadAndPredict generates PAI - TF prediction program .
func TFLoadAndPredict(ir *ir.PredictStmt, session *pb.Session, modelPath string) (string, error) {
	var tpl = template.Must(template.New("Predict").Parse(tfPredictTmplText))
	ossModelDir := OSSModelURL(modelPath)
	paiPredictTable := ""
	if tensorflow.IsPAI() && ir.TmpPredictTable != "" {
		paiPredictTable = ir.TmpPredictTable
	}
	filler := predictFiller{
		OSSModelDir: ossModelDir,
		DataSource:  session.DbConnStr,
		Select:      ir.Select,
		ResultTable: ir.ResultTable,
		IsPAI:       tensorflow.IsPAI(),
		PAITable:    paiPredictTable,
		Using:       ir.Using,
	}
	var code bytes.Buffer
	if err := tpl.Execute(&code, filler); err != nil {
		return "", err
	}
	return code.String(), nil
}
func TFLoadAndPredict ( ir * ir . PredictStmt , session * pb . Session , modelPath string ) ( string , error ) { var tpl = template . Must ( template . New ( " " ) . Parse ( tfPredictTmplText ) ) ossModelDir := OSSModelURL ( modelPath ) paiPredictTable := " " if tensorflow . IsPAI ( ) && ir . TmpPredictTable != " " { paiPredictTable = ir . TmpPredictTable } filler := predictFiller { OSSModelDir : ossModelDir , DataSource : session . DbConnStr , Select : ir . Select , ResultTable : ir . ResultTable , IsPAI : tensorflow . IsPAI ( ) , PAITable : paiPredictTable , Using : ir . Using , } var code bytes . Buffer if err := tpl . Execute ( & code , filler ) ; err != nil { return " " , err } return code . String ( ) , nil }
TFLoadAndPredict generates PAI-TF prediction program.
TFLoadAndPredict generates PAI - TF prediction program .