mirror of
https://github.com/pykeio/ort
synced 2026-04-25 16:34:55 +02:00
refactor: rename SessionBuilder commit methods
This commit is contained in:
@@ -13,7 +13,7 @@ fn mnist_5() -> ort::Result<()> {
|
||||
let session = Session::builder()?
|
||||
.with_optimization_level(GraphOptimizationLevel::Level1)?
|
||||
.with_intra_threads(1)?
|
||||
.with_model_downloaded("https://parcel.pyke.io/v2/cdn/assetdelivery/ortrsv2/ex_models/mnist.onnx")
|
||||
.commit_from_url("https://parcel.pyke.io/v2/cdn/assetdelivery/ortrsv2/ex_models/mnist.onnx")
|
||||
.expect("Could not download model from file");
|
||||
|
||||
let metadata = session.metadata()?;
|
||||
|
||||
@@ -19,7 +19,7 @@ fn squeezenet_mushroom() -> ort::Result<()> {
|
||||
let session = Session::builder()?
|
||||
.with_optimization_level(GraphOptimizationLevel::Level1)?
|
||||
.with_intra_threads(1)?
|
||||
.with_model_downloaded("https://parcel.pyke.io/v2/cdn/assetdelivery/ortrsv2/ex_models/squeezenet.onnx")
|
||||
.commit_from_url("https://parcel.pyke.io/v2/cdn/assetdelivery/ortrsv2/ex_models/squeezenet.onnx")
|
||||
.expect("Could not download model from file");
|
||||
|
||||
let metadata = session.metadata()?;
|
||||
|
||||
@@ -51,7 +51,7 @@ fn upsample() -> ort::Result<()> {
|
||||
let session = Session::builder()?
|
||||
.with_optimization_level(GraphOptimizationLevel::Level1)?
|
||||
.with_intra_threads(1)?
|
||||
.with_model_from_memory(&session_data)
|
||||
.commit_from_memory(&session_data)
|
||||
.expect("Could not read model from memory");
|
||||
|
||||
let metadata = session.metadata()?;
|
||||
@@ -92,7 +92,7 @@ fn upsample_with_ort_model() -> ort::Result<()> {
|
||||
let session = Session::builder()?
|
||||
.with_optimization_level(GraphOptimizationLevel::Level1)?
|
||||
.with_intra_threads(1)?
|
||||
.with_model_from_memory_directly(&session_data) // Zero-copy.
|
||||
.commit_from_memory_directly(&session_data) // Zero-copy.
|
||||
.expect("Could not read model from memory");
|
||||
|
||||
assert_eq!(session.inputs[0].input_type.tensor_dimensions().expect("input0 to be a tensor type"), &[-1, -1, -1, 3]);
|
||||
|
||||
@@ -11,7 +11,7 @@ fn vectorizer() -> ort::Result<()> {
|
||||
let session = Session::builder()?
|
||||
.with_optimization_level(GraphOptimizationLevel::Level1)?
|
||||
.with_intra_threads(1)?
|
||||
.with_model_from_file(Path::new(env!("CARGO_MANIFEST_DIR")).join("tests").join("data").join("vectorizer.onnx"))
|
||||
.commit_from_file(Path::new(env!("CARGO_MANIFEST_DIR")).join("tests").join("data").join("vectorizer.onnx"))
|
||||
.expect("Could not load model");
|
||||
|
||||
let metadata = session.metadata()?;
|
||||
|
||||
Reference in New Issue
Block a user