#include "coco/IR/Input.h"
+#include "coco/IR/BagManager.h"
#include <nncc/core/ADT/tensor/IndexEnumerator.h>
TEST(IR_INPUT, bag_update)
{
+ // Create a bag
+ coco::PtrLink<coco::Bag, coco::BagInfo> bag_link;
+ coco::BagManager bag_mgr{&bag_link};
+
+ auto bag = bag_mgr.create(9);
+
const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1};
coco::Input input{shape};
- coco::Bag bag{9};
- input.bag(&bag);
- ASSERT_EQ(input.bag(), &bag);
+ input.bag(bag);
+ ASSERT_EQ(input.bag(), bag);
}
TEST(IR_INPUT, name_update)
#include "coco/IR/Output.h"
+#include "coco/IR/BagManager.h"
#include <nncc/core/ADT/tensor/IndexEnumerator.h>
TEST(IR_OUTPUT, bag_update)
{
+ // Create a bag for test
+ coco::PtrLink<coco::Bag, coco::BagInfo> bag_link;
+ coco::BagManager bag_mgr{&bag_link};
+
+ auto bag = bag_mgr.create(9);
+
const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1};
coco::Output output{shape};
- coco::Bag bag{1};
- output.bag(&bag);
- ASSERT_EQ(output.bag(), &bag);
+ output.bag(bag);
+ ASSERT_EQ(output.bag(), bag);
}
TEST(IR_OUTPUT, name_update)