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

Function binary_helper

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

Source from the content-addressed store, hash-verified

67 }
68
69 fn binary_helper(
70 operation: impl CustomOperationBody,
71 arg1: TypedValue,
72 arg2: TypedValue,
73 ) -> Result<()> {
74 let c = simple_context(|g| {
75 let i1 = g.input(arg1.t)?;
76 let i2 = g.input(arg2.t)?;
77 let b1 = i1.a2b()?;
78 let b2 = i2.a2b()?;
79 g.custom_op(CustomOperation::new(operation), vec![b1, b2])
80 })?;
81 let c = run_instantiation_pass(c)?.context;
82 random_evaluate(c.get_main_graph()?, vec![arg1.value, arg2.value])?;
83 Ok(())
84 }
85
86 #[test]
87 fn test_arithemtic_custom_op_broadcast() -> Result<()> {

Callers 1

Calls 7

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

Tested by

no test coverage detected