fn handle(matches: clap::ArgMatches) -> CliResult<()> {
    if matches.is_present("list_ops") {
        #[cfg(feature = "onnx")]
        {
            let onnx = tract_onnx::onnx();
            let names = onnx.op_register.names().sorted().into_iter().join(", ");
            println!("Onnx:\n");
            println!("{}", names);
            println!("\n");
        }
        #[cfg(feature = "tf")]
        {
            let tf = tract_tensorflow::tensorflow();
            let names = tf.op_register.names().sorted().into_iter().join(", ");
            println!("Tensorflow:\n");
            println!("{}", names);
            println!("\n");
        }
        return Ok(());
    }

    let mut params = Parameters::from_clap(&matches)?;

    match matches.subcommand() {
        #[cfg(feature = "conform")]
        ("compare", Some(m)) => compare::handle(params, display_options_from_clap(m)?),
        #[cfg(not(feature = "conform"))]
        ("compare", _) => bail!("Need conform feature to be able to run comparison"),

        ("run", Some(m)) => {
            params.assertions = Some(Assertions::from_clap(m)?);
            run::handle(params)
        }

        ("optimize-check", Some(m)) => {
            optimize_check::handle(params, display_options_from_clap(m)?)
        }

        ("stream-check", Some(m)) => stream_check::handle(params, display_options_from_clap(m)?),

        ("cost", Some(m)) => crate::cost::handle(params, display_options_from_clap(m)?),

        ("draw", Some(m)) => {
            crate::draw::render(&params.tract_model, display_options_from_clap(m)?)
        }

        ("dump", Some(m)) => {
            params.assertions = Some(Assertions::from_clap(m)?);
            dump::handle(params, display_options_from_clap(m)?)
        }

        ("profile", Some(m)) => {
            if !matches.is_present("optimize") {
                warn!("Profiling un-optimized network. Consider adding -O.");
            }
            profile::handle(params, ProfilingMode::from_clap(&m)?, display_options_from_clap(m)?)
        }

        (s, _) => bail!("Unknown subcommand {}.", s),
    }
}
/// Handles the command-line input.
Handles the command-line input.
Handles the command - line input .
fn handle(matches: clap::ArgMatches) -> CliResult<()> {
    if matches.is_present("list_ops") {
        #[cfg(feature = "onnx")]
        {
            let onnx = tract_onnx::onnx();
            let names = onnx.op_register.names().sorted().into_iter().join(", ");
            println!("Onnx:\n");
            println!("{}", names);
            println!("\n");
        }
        #[cfg(feature = "tf")]
        {
            let tf = tract_tensorflow::tensorflow();
            let names = tf.op_register.names().sorted().into_iter().join(", ");
            println!("Tensorflow:\n");
            println!("{}", names);
            println!("\n");
        }
        return Ok(());
    }
    let mut params = Parameters::from_clap(&matches)?;
    match matches.subcommand() {
        #[cfg(feature = "conform")]
        ("compare", Some(m)) => compare::handle(params, display_options_from_clap(m)?),
        #[cfg(not(feature = "conform"))]
        ("compare", _) => bail!("Need conform feature to be able to run comparison"),
        ("run", Some(m)) => {
            params.assertions = Some(Assertions::from_clap(m)?);
            run::handle(params)
        }
        ("optimize-check", Some(m)) => {
            optimize_check::handle(params, display_options_from_clap(m)?)
        }
        ("stream-check", Some(m)) => stream_check::handle(params, display_options_from_clap(m)?),
        ("cost", Some(m)) => crate::cost::handle(params, display_options_from_clap(m)?),
        ("draw", Some(m)) => {
            crate::draw::render(&params.tract_model, display_options_from_clap(m)?)
        }
        ("dump", Some(m)) => {
            params.assertions = Some(Assertions::from_clap(m)?);
            dump::handle(params, display_options_from_clap(m)?)
        }
        ("profile", Some(m)) => {
            if !matches.is_present("optimize") {
                warn!("Profiling un-optimized network. Consider adding -O.");
            }
            profile::handle(params, ProfilingMode::from_clap(&m)?, display_options_from_clap(m)?)
        }
        (s, _) => bail!("Unknown subcommand {}.", s),
    }
}
fn handle ( matches : clap :: ArgMatches ) -> CliResult < ( ) > { if matches . is_present ( " " ) { # [ cfg ( feature " " ) ] { let onnx = tract_onnx :: onnx ( ) ; let names = onnx . op_register . names ( ) . sorted ( ) . into_iter ( ) . join ( " " ) ; println ! ( " \n " ) ; println ! ( " " names ) ; println ! ( " \n " ) ; } # [ cfg ( feature " " ) ] { let tf = tract_tensorflow :: tensorflow ( ) ; let names = tf . op_register . names ( ) . sorted ( ) . into_iter ( ) . join ( " " ) ; println ! ( " \n " ) ; println ! ( " " names ) ; println ! ( " \n " ) ; } return Ok ( ( ) ) ; } let mut params = Parameters :: from_clap ( & matches ) ? ; match matches . subcommand ( ) { # [ cfg ( feature " " ) ] ( " " , Some ( m ) ) => compare :: handle ( params , display_options_from_clap ( m ) ? ) , # [ cfg ( not ( feature " " ) ) ] ( " " , _ ) => bail ! ( " " ) , ( " " , Some ( m ) ) => { params . assertions = Some ( Assertions :: from_clap ( m ) ? ) ; run :: handle ( params ) } ( " " , Some ( m ) ) => { optimize_check :: handle ( params , display_options_from_clap ( m ) ? ) } ( " " , Some ( m ) ) => stream_check :: handle ( params , display_options_from_clap ( m ) ? ) , ( " " , Some ( m ) ) => crate :: cost :: handle ( params , display_options_from_clap ( m ) ? ) , ( " " , Some ( m ) ) => { crate :: draw :: render ( & params . tract_model , display_options_from_clap ( m ) ? ) } ( " " , Some ( m ) ) => { params . assertions = Some ( Assertions :: from_clap ( m ) ? ) ; dump :: handle ( params , display_options_from_clap ( m ) ? ) } ( " " , Some ( m ) ) => { if ! matches . is_present ( " " ) { warn ! ( " " ) ; } profile :: handle ( params , ProfilingMode :: from_clap ( & m ) ? , display_options_from_clap ( m ) ? ) } ( s , _ ) => bail ! ( " " s ) , } }
Handles the command-line input.
Handles the command - line input .
matches
clap::ArgMatches
matches
clap::ArgMatches