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

Function arithmetic_helper

ciphercore-base/src/ops/broadcast_test.rs:120–133  ·  view source on GitHub ↗
(
        operation: impl CustomOperationBody,
        arg1: TypedValue,
        arg2: TypedValue,
    )

Source from the content-addressed store, hash-verified

118 }
119
120 fn arithmetic_helper(
121 operation: impl CustomOperationBody,
122 arg1: TypedValue,
123 arg2: TypedValue,
124 ) -> Result<()> {
125 let c = simple_context(|g| {
126 let i1 = g.input(arg1.t)?;
127 let i2 = g.input(arg2.t)?;
128 g.custom_op(CustomOperation::new(operation), vec![i1, i2])
129 })?;
130 let c = run_instantiation_pass(c)?.context;
131 random_evaluate(c.get_main_graph()?, vec![arg1.value, arg2.value])?;
132 Ok(())
133 }
134}

Callers 1

Calls 6

simple_contextFunction · 0.85
run_instantiation_passFunction · 0.85
random_evaluateFunction · 0.85
inputMethod · 0.45
custom_opMethod · 0.45
get_main_graphMethod · 0.45

Tested by

no test coverage detected