()
| 4844 | |
| 4845 | #[test] |
| 4846 | fn test_wellformed_cases() { |
| 4847 | let context = create_unchecked_context().unwrap(); |
| 4848 | let graph = context.create_graph().unwrap(); |
| 4849 | let input1 = graph.input(scalar_type(BIT)).unwrap(); |
| 4850 | let input2 = graph.input(scalar_type(BIT)).unwrap(); |
| 4851 | graph.add(input1.clone(), input2.clone()).unwrap(); |
| 4852 | graph.subtract(input1.clone(), input2.clone()).unwrap(); |
| 4853 | graph.multiply(input1.clone(), input2.clone()).unwrap(); |
| 4854 | graph.dot(input1.clone(), input2.clone()).unwrap(); |
| 4855 | graph.matmul(input1.clone(), input2.clone()).unwrap(); |
| 4856 | graph.truncate(input1.clone(), 123).unwrap(); |
| 4857 | let input3 = graph.input(array_type(vec![10, 20, 30], BIT)).unwrap(); |
| 4858 | graph.sum(input3.clone(), vec![1, 2]).unwrap(); |
| 4859 | graph.permute_axes(input3.clone(), vec![1, 2, 0]).unwrap(); |
| 4860 | graph.get(input3.clone(), vec![1, 2]).unwrap(); |
| 4861 | graph |
| 4862 | .reshape(input3.clone(), array_type(vec![20, 300], BIT)) |
| 4863 | .unwrap(); |
| 4864 | graph.nop(input3.clone()).unwrap(); |
| 4865 | let key = graph.random(array_type(vec![128], BIT)).unwrap(); |
| 4866 | graph |
| 4867 | .prf(key.clone(), 0, array_type(vec![10, 10], UINT64)) |
| 4868 | .unwrap(); |
| 4869 | graph |
| 4870 | .stack(vec![input1.clone(), input2.clone()], vec![2, 1]) |
| 4871 | .unwrap(); |
| 4872 | let c = graph |
| 4873 | .constant(scalar_type(BIT), Value::from_bytes(vec![1])) |
| 4874 | .unwrap(); |
| 4875 | let input4 = graph.input(array_type(vec![10, 10], UINT64)).unwrap(); |
| 4876 | let bits = graph.a2b(input4.clone()).unwrap(); |
| 4877 | graph.b2a(bits.clone(), UINT64).unwrap(); |
| 4878 | let t = graph |
| 4879 | .create_tuple(vec![input1.clone(), input2.clone()]) |
| 4880 | .unwrap(); |
| 4881 | let _v = graph |
| 4882 | .create_vector(scalar_type(BIT), vec![input1.clone(), input2.clone()]) |
| 4883 | .unwrap(); |
| 4884 | let nt = graph |
| 4885 | .create_named_tuple(vec![ |
| 4886 | ("Name".to_owned(), input1.clone()), |
| 4887 | ("Gender".to_owned(), input2.clone()), |
| 4888 | ]) |
| 4889 | .unwrap(); |
| 4890 | graph.tuple_get(t, 1).unwrap(); |
| 4891 | graph.named_tuple_get(nt, "Gender".to_owned()).unwrap(); |
| 4892 | let v = graph.repeat(c.clone(), 100).unwrap(); |
| 4893 | graph.zip(vec![v.clone(), v.clone(), v.clone()]).unwrap(); |
| 4894 | let zero = graph |
| 4895 | .constant(scalar_type(UINT64), Value::from_bytes(vec![0; 8])) |
| 4896 | .unwrap(); |
| 4897 | graph.vector_get(v, zero).unwrap(); |
| 4898 | graph.array_to_vector(input1.clone()).unwrap(); |
| 4899 | graph.vector_to_array(input1.clone()).unwrap(); |
| 4900 | } |
| 4901 | |
| 4902 | #[test] |
| 4903 | fn call_iterate_test() { |
nothing calls this directly
no test coverage detected