@Test public void makeFromUnsupportedOnnxOpsetVersionFile() throws Exception { final String path = getResourceFilePath("models/unsupported_onnx_opset_version.onnx"); MenohException e = assertThrows(MenohException.class, () -> ModelData.fromOnnxFile(path)); assertAll("invalid onnx file", () -> assertEquals(ErrorCode.UNSUPPORTED_ONNX_OPSET_VERSION, e.getErrorCode()), () -> assertEquals( String.format( "menoh unsupported onnx opset version error: %s has " + "onnx opset version %d > %d (unsupported_onnx_opset_version)", path, 127, 7), e.getMessage()) ); }
public static ModelData fromOnnxFile(String onnxModelPath) throws MenohException { final PointerByReference handle = new PointerByReference(); checkError(MenohNative.INSTANCE.menoh_make_model_data_from_onnx(onnxModelPath, handle)); return new ModelData(handle.getValue()); }
ModelData implements AutoCloseable { public static ModelData fromOnnxFile(String onnxModelPath) throws MenohException { final PointerByReference handle = new PointerByReference(); checkError(MenohNative.INSTANCE.menoh_make_model_data_from_onnx(onnxModelPath, handle)); return new ModelData(handle.getValue()); } }
ModelData implements AutoCloseable { public static ModelData fromOnnxFile(String onnxModelPath) throws MenohException { final PointerByReference handle = new PointerByReference(); checkError(MenohNative.INSTANCE.menoh_make_model_data_from_onnx(onnxModelPath, handle)); return new ModelData(handle.getValue()); } private  ModelData(Pointer handle); }
ModelData implements AutoCloseable { public static ModelData fromOnnxFile(String onnxModelPath) throws MenohException { final PointerByReference handle = new PointerByReference(); checkError(MenohNative.INSTANCE.menoh_make_model_data_from_onnx(onnxModelPath, handle)); return new ModelData(handle.getValue()); } private  ModelData(Pointer handle); ModelData optimize(VariableProfileTable vpt); @Override void close(); static ModelData fromOnnxFile(String onnxModelPath); }
ModelData implements AutoCloseable { public static ModelData fromOnnxFile(String onnxModelPath) throws MenohException { final PointerByReference handle = new PointerByReference(); checkError(MenohNative.INSTANCE.menoh_make_model_data_from_onnx(onnxModelPath, handle)); return new ModelData(handle.getValue()); } private  ModelData(Pointer handle); ModelData optimize(VariableProfileTable vpt); @Override void close(); static ModelData fromOnnxFile(String onnxModelPath);  }