| 102 | } |
| 103 | |
| 104 | Node* RandomZeroOrOne(Graph* const g, const int n) { |
| 105 | Tensor data(DT_FLOAT, TensorShape({n})); |
| 106 | test::FillFn<float>(&data, [](const int i) { |
| 107 | // Fill with 0.0 or 1.0 at random. |
| 108 | return (random::New64() % 2) == 0 ? 0.0f : 1.0f; |
| 109 | }); |
| 110 | return test::graph::Constant(g, data); |
| 111 | } |
| 112 | |
| 113 | Node* RandomZeroOrOneMatrix(Graph* const g, const int n, int d) { |
| 114 | Tensor data(DT_FLOAT, TensorShape({n, d})); |
no test coverage detected