From a22661bb5bb57adc3a02093d00a0ef57650eb8d3 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Mon, 28 Aug 2023 14:49:21 +0200 Subject: [PATCH] change parameters names --- cli/src/main.rs | 20 +++++++++++--------- cli/src/run.rs | 4 ++-- cli/src/tensor.rs | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 684ffaa5f1..a8cc6eab82 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -195,16 +195,17 @@ fn main() -> tract_core::anyhow::Result<()> { .long_about("Run the graph") .arg(Arg::new("dump").long("dump").help("Show output")) .arg( - Arg::new("save-outputs") - .long("save-outputs") + Arg::new("save-outputs-npz") + .long("save-outputs-npz") + .alias("save-outputs") .takes_value(true) .help("Save the outputs into a npz file"), ) .arg( - Arg::new("save-output-tensors") - .long("save-output-tensors") + Arg::new("save-outputs-nnef") + .long("save-outputs-nnef") .takes_value(true) - .help("Save the output tensor into a .dat file"), + .help("Save the output tensor into a folder of nnef .dat files"), ) .arg(Arg::new("steps").long("steps").help("Show all inputs and outputs")) .arg( @@ -401,14 +402,15 @@ fn run_options(command: clap::Command) -> clap::Command { use clap::*; command .arg( - Arg::new("input-from-bundle") - .long("input-from-bundle") + Arg::new("input-from-npz") + .long("input-from-npz") + .alias("input-from-bundle") .takes_value(true) .help("Path to an input container (.npz). This sets tensor values."), ) .arg( - Arg::new("input-from-tensors").long("input-from-tensors").takes_value(true).help( - "Path to a directory containing input tensors (.dat). This sets tensor values.", + Arg::new("input-from-nnef").long("input-from-nnef").takes_value(true).help( + "Path to a directory containing input tensors in NNEF format (.dat files). This sets tensor values.", ), ) .arg( diff --git a/cli/src/run.rs b/cli/src/run.rs index dc3ee4cc1c..4dea92bdd8 100644 --- a/cli/src/run.rs +++ b/cli/src/run.rs @@ -60,7 +60,7 @@ pub fn handle( } } - if let Some(file_path) = sub_matches.value_of("save-output-tensors") { + if let Some(file_path) = sub_matches.value_of("save-outputs-nnef") { std::fs::create_dir_all(file_path) .with_context(|| format!("Creating {file_path} directory"))?; for (ix, outputs) in outputs.iter().enumerate() { @@ -83,7 +83,7 @@ pub fn handle( } } - if let Some(file_path) = sub_matches.value_of("save-outputs") { + if let Some(file_path) = sub_matches.value_of("save-outputs-npz") { let file = std::fs::File::create(file_path).with_context(|| format!("Creating {file_path}"))?; let mut npz = ndarray_npy::NpzWriter::new_compressed(file); diff --git a/cli/src/tensor.rs b/cli/src/tensor.rs index 161307a93b..72dc3d0342 100644 --- a/cli/src/tensor.rs +++ b/cli/src/tensor.rs @@ -9,7 +9,7 @@ pub fn run_params_from_subcommand( ) -> TractResult { let mut tv = params.tensors_values.clone(); - if let Some(bundle) = sub_matches.values_of("input-from-bundle") { + if let Some(bundle) = sub_matches.values_of("input-from-npz") { for input in bundle { for tensor in Parameters::parse_npz(input, true, false)? { tv.add(tensor); @@ -17,7 +17,7 @@ pub fn run_params_from_subcommand( } } - if let Some(dir) = sub_matches.value_of("input-from-tensors") { + if let Some(dir) = sub_matches.value_of("input-from-nnef") { for tensor in Parameters::parse_nnef_tensors(dir, true, false)? { tv.add(tensor); }