This binary prints statistics of a given serialized context. # Arguments `input_path` - path to a serialized context `prepare` - (optional) flag to inline, instantiate custom operations and optimize graphs in a given context `inline_mode` - (optional) mode of inlining that unrolls operation nodes in graphs. Possible values are `simple`, `depth-optimized-default`, `depth-optimized-extreme`. The d
()
| 332 | /// |
| 333 | /// `< this_binary > <input_path> <prepare> <inline_mode>` |
| 334 | fn main() { |
| 335 | // Initialize a logger that collects information about errors and panics within CipherCore. |
| 336 | // This information can be accessed via RUST_LOG. |
| 337 | env_logger::init(); |
| 338 | // Execute CipherCore code such that all the internal errors are properly formatted and logged. |
| 339 | execute_main(|| -> Result<()> { |
| 340 | let args = Args::parse(); |
| 341 | let buffer = fs::read_to_string(&args.input_path)?; |
| 342 | let context = serde_json::from_str::<Context>(&buffer).unwrap(); |
| 343 | let context2 = if args.prepare { |
| 344 | let evaluator0 = get_evaluator()?; |
| 345 | prepare_context( |
| 346 | context, |
| 347 | InlineConfig { |
| 348 | default_mode: get_inline_mode(args.inline_mode), |
| 349 | ..Default::default() |
| 350 | }, |
| 351 | evaluator0, |
| 352 | false, |
| 353 | )? |
| 354 | } else { |
| 355 | context |
| 356 | }; |
| 357 | |
| 358 | eprintln!("Calculating stats..."); |
| 359 | print_stats(context2.get_main_graph()?)?; |
| 360 | Ok(()) |
| 361 | }); |
| 362 | } |
nothing calls this directly
no test coverage detected