Use int64 stride everywhere (#1671)

* use int64 stride everywhere

* fix ext

* fix ext

* more shape + cleanup

* one more

* few more
This commit is contained in:
Awni Hannun
2024-12-09 11:09:02 -08:00
committed by GitHub
parent 35b412c099
commit 40c62c1321
102 changed files with 1262 additions and 1705 deletions

View File

@@ -208,14 +208,14 @@ TEST_CASE("test full") {
// Check zeros and ones
{
auto x = zeros({2, 2}, float32);
CHECK_EQ(x.shape(), std::vector<int>{2, 2});
CHECK_EQ(x.shape(), Shape{2, 2});
CHECK_EQ(x.ndim(), 2);
CHECK_EQ(x.dtype(), float32);
auto y = array({0.0, 0.0, 0.0, 0.0}, {2, 2});
CHECK(array_equal(x, y).item<bool>());
x = ones({2, 2}, float32);
CHECK_EQ(x.shape(), std::vector<int>{2, 2});
CHECK_EQ(x.shape(), Shape{2, 2});
CHECK_EQ(x.ndim(), 2);
CHECK_EQ(x.dtype(), float32);
y = array({1.0, 1.0, 1.0, 1.0}, {2, 2});
@@ -235,11 +235,11 @@ TEST_CASE("test full") {
// Works for empty shape and empty array
{
array x = ones({}, int32);
CHECK_EQ(x.shape(), std::vector<int>{});
CHECK_EQ(x.shape(), Shape{});
CHECK_EQ(x.item<int>(), 1);
x = full({0}, array({}));
CHECK_EQ(x.shape(), std::vector<int>{0});
CHECK_EQ(x.shape(), Shape{0});
CHECK_EQ(x.size(), 0);
CHECK_THROWS_AS(full({}, array({})), std::invalid_argument);