docstr: Predict using a the trained model after HPO(Hyper Parameter Optimization).
  
  Be sure to install onnx and onnxruntime to enable this function. The method
  will give exactly the same result as .predict() but with higher throughput
  and lower latency.
  
  :param data: a numpy ndarray x, where x's shape is (num_samples, lookback, feature_dim)
         where lookback and feature_dim should be the same as past_seq_len and
         input_feature_num.
  :param batch_size: predict batch size. The value will not affect predict
         result but will affect resources cost(e.g. memory and time). The value
         defaults to 32.
  :param dirname: The directory to save onnx model file. This value defaults
         to None for no saving file.
  
  :return: A numpy array with shape (num_samples, horizon, target_dim).
docstr_tok: ["Predict","using","a","the","trained","model","after","HPO","(","Hyper","Parameter","Optimization",")",".","Be","sure","to","install","onnx","and","onnxruntime","to","enable","this","function",".","The","method","will","give","exactly","the","same","result","as",".predict","(",")","but","with","higher","throughput","and","lower","latency",".",":","param","data",":","a","numpy","ndarray","x",",","where","x","'s","shape","is","(","num_samples",",","lookback",",","feature_dim",")","where","lookback","and","feature_dim","should","be","the","same","as","past_seq_len","and","input_feature_num",".",":","param","batch_size",":","predict","batch","size",".","The","value","will","not","affect","predict","result","but","will","affect","resources","cost","(","e.g",".","memory","and","time",")",".","The","value","defaults","to","32.",":","param","dirname",":","The","directory","to","save","onnx","model","file",".","This","value","defaults","to","None","for","no","saving","file",".",":","return",":","A","numpy","array","with","shape","(","num_samples",",","horizon",",","target_dim",")","."]
code: def predict_with_onnx(self, data, batch_size=32, dirname=None):
      """
      Predict using a the trained model after HPO(Hyper Parameter Optimization).
  
      Be sure to install onnx and onnxruntime to enable this function. The method
      will give exactly the same result as .predict() but with higher throughput
      and lower latency.
  
      :param data: a numpy ndarray x, where x's shape is (num_samples, lookback, feature_dim)
             where lookback and feature_dim should be the same as past_seq_len and
             input_feature_num.
      :param batch_size: predict batch size. The value will not affect predict
             result but will affect resources cost(e.g. memory and time). The value
             defaults to 32.
      :param dirname: The directory to save onnx model file. This value defaults
             to None for no saving file.
  
      :return: A numpy array with shape (num_samples, horizon, target_dim).
      """
      if self.best_model is None:
          raise RuntimeError(
              "You must call fit or load first before calling predict!"
          )
      return self.best_model.predict_with_onnx(
          data, batch_size=batch_size, dirname=dirname
      )
  
file_path: analytics-zoo/pyzoo/zoo/chronos/autots/model/base_automodel.py
imports: import os
  import json
label_desc: Use image node_id 4 for calling the BasePytorchAutomodel obj's underlying member method code with example usage: obj.predict_with_onnx(data, batch_size, dirname) and returns: self