MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / main

Function main

ciphercore-base/src/bin/ciphercore_inspect.rs:334–362  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

332///
333/// `< this_binary > <input_path> <prepare> <inline_mode>`
334fn 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}

Callers

nothing calls this directly

Calls 6

execute_mainFunction · 0.85
get_evaluatorFunction · 0.70
get_inline_modeFunction · 0.70
print_statsFunction · 0.70
prepare_contextFunction · 0.50
get_main_graphMethod · 0.45

Tested by

no test coverage detected