@Test public void makeFromInvalidOnnxFile() throws Exception { final String path = getResourceFilePath("models/invalid_format.onnx"); MenohException e = assertThrows(MenohException.class, () -> ModelData.fromOnnxFile(path)); assertAll("invalid onnx file", () -> assertEquals(ErrorCode.ONNX_PARSE_ERROR, e.getErrorCode()), () -> assertEquals( String.format("menoh onnx parse error: %s (onnx_parse_error)", path), 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);  }