def test_save_onnx(self): with tempfile.TemporaryDirectory() as outdir: outpath = os.path.join(outdir, "test", "nested") loader = SaveOnnx(OnnxFromPath(ONNX_MODELS["identity"].path), path=outpath) loader() assert is_file_non_empty(outpath)
def test_external_data(self): with util.NamedTemporaryFile() as path, util.NamedTemporaryFile( ) as data: model = OnnxFromPath(ONNX_MODELS["const_foldable"].path) loader = SaveOnnx(model, path.name, external_data_path=data.name, size_threshold=0) loader() assert is_file_non_empty(path.name) assert is_file_non_empty(data.name)
def test_save_onnx(self): with tempfile.NamedTemporaryFile() as outpath: loader = SaveOnnx(OnnxFromPath(ONNX_MODELS["identity"].path), path=outpath.name) loader() check_file_non_empty(outpath.name)