/*
 * Copyright 2018 Analytics Zoo Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.intel.analytics.zoo.pipeline.inference;

import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

public abstract class AbstractInferenceModel {
  private FloatInferenceModel model;

  private int supportedConcurrentNum = 1;

  public AbstractInferenceModel(){
  }

  public AbstractInferenceModel(int supportedConcurrentNum){
    this.supportedConcurrentNum = supportedConcurrentNum;
  }

  public void load(String modelPath) {
    load(modelPath, null);
  }

  public void load(String modelPath, String weightPath) {
    this.model = InferenceModelFactory.loadFloatInferenceModel(modelPath, weightPath);
  }

  public void reload(String modelPath) {
    load(modelPath, null);
  }

  public void reload(String modelPath, String weightPath) {
    this.model = InferenceModelFactory.loadFloatInferenceModel(modelPath, weightPath);
  }

  public List<Float> predict(List<List<Float>> input) {
     return model.predict(input);
  }
}

@@ -653,16 +653,84 @@
 rence;%0A%0A
+import scala.actors.threadpool.Arrays;%0A%0Aimport java.util.ArrayList;%0A
 import j
@@ -1570,31 +1570,150 @@
 ist%3C
-List%3CFloat%3E%3E input) %7B%0A 
+Float%3E input, int... shape) %7B%0A    List%3CInteger%3E inputShape = new ArrayList%3CInteger%3E();%0A    for(int s: shape) %7B%0A      inputShape.add(s);%0A    %7D%0A
     
@@ -1738,17 +1738,30 @@
 ct(input
+, inputShape
 );%0A  %7D%0A
+%0A
 %7D%0A

fix inferncemodel missing input shape (#310)