Fix RandomBits::is_equivalent to include width (#2978)

Co-authored-by: KD2YCU <[email protected]>
Co-authored-by: Angelos Katharopoulos <[email protected]>
Co-authored-by: Awni Hannun <[email protected]>
This commit is contained in:
MillaFleurs
2026-01-13 12:42:37 -08:00
committed by GitHub
co-authored by KD2YCU Angelos Katharopoulos Awni Hannun
parent a8197795f5
commit 4160ec10f7
3 changed files with 15 additions and 1 deletions
+13
View File
@@ -803,3 +803,16 @@ TEST_CASE("test compile with no-ops") {
auto out = compile(fun)({in})[0];
CHECK_EQ(out.inputs()[0].id(), in.id());
}
TEST_CASE("test compile random bits") {
auto fun = [](const std::vector<array>& inputs) {
auto key = inputs[0];
auto a = random::bits({32, 32}, 4, key);
auto b = random::bits({32, 32}, 2, key);
return std::vector<array>{a + b};
};
auto in = random::key(0);
auto expected = fun({in})[0];
auto out = compile(fun)({in})[0];
CHECK(array_equal(out, expected).item<bool>());
}