We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4cedb6e + 751ff2e commit 1f4a2b0Copy full SHA for 1f4a2b0
extension/pytree/test/test_pytree.cpp
@@ -11,13 +11,27 @@
11
#include <gtest/gtest.h>
12
#include <string>
13
14
+using ::executorch::extension::pytree::arr;
15
using ::executorch::extension::pytree::ContainerHandle;
16
using ::executorch::extension::pytree::Key;
17
using ::executorch::extension::pytree::Kind;
18
using ::executorch::extension::pytree::unflatten;
19
20
using Leaf = int32_t;
21
22
+TEST(PyTreeTest, ArrBasic) {
23
+ arr<int> x(5);
24
+ ASSERT_EQ(x.size(), 5);
25
+ for (int ii = 0; ii < x.size(); ++ii) {
26
+ x[ii] = 2 * ii;
27
+ }
28
+ int idx = 0;
29
+ for (const auto item : x) {
30
+ EXPECT_EQ(item, 2 * idx);
31
+ ++idx;
32
33
+}
34
+
35
TEST(PyTreeTest, List) {
36
Leaf items[2] = {11, 12};
37
std::string spec = "L2#1#1($,$)";
0 commit comments