Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie committed Oct 25, 2023
1 parent bbd48ca commit 86c1e57
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/tests/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ TEST(tensor, wrap_tensor_with_unspecified_type_from_host_tensor) {
// !tensor means that the tensor is not initialized
EXPECT_EQ(!tensor, true);
}

TEST(tensor, create_tensor_with_zero_dims_check_stride) {
ov::Shape shape = {0, 0, 0, 0};
auto tensor = ov::Tensor(element::f32, shape);
EXPECT_EQ(!!tensor, true);
auto stride = tensor.get_strides();
EXPECT_EQ(stride.size(), shape.size());
EXPECT_EQ(stride.back(), 0);
}

0 comments on commit 86c1e57

Please sign in to comment.