Skip to content

Commit

Permalink
Add test for reserved tensor
Browse files Browse the repository at this point in the history
Reserved tensor now has a proper test, allocating 3 uint32_t.

Signed-off-by: Andrea Calabrese <[email protected]>
  • Loading branch information
ThePseudo committed Jul 29, 2024
1 parent 72bbb69 commit 7dbb99b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/TestTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ TEST(TestTensor, ConstructorData)
EXPECT_EQ(tensor->vector(), vec);
}

TEST(TestTensor, ReserveData)
{
kp::Manager mgr;
std::shared_ptr<kp::TensorT<float>> tensor = mgr.tensor(3, sizeof(uint32_t), Tensor::TensorDataType::eUnsignedInt);
EXPECT_EQ(tensor->size(), 0);
EXPECT_EQ(tensor->dataTypeMemorySize(), sizeof(uint32_t));
}

TEST(TestTensor, DataTypes)
{
kp::Manager mgr;
Expand Down

0 comments on commit 7dbb99b

Please sign in to comment.