(
operation: impl CustomOperationBody,
arg1: TypedValue,
arg2: TypedValue,
)
| 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<()> { |
no test coverage detected