2022-09-29 14:52:50 +08:00
|
|
|
#include "core/graph.h"
|
|
|
|
#include "core/kernel.h"
|
|
|
|
#include "core/runtime.h"
|
|
|
|
#include "operators/extend.h"
|
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
|
|
|
namespace infini {
|
|
|
|
|
|
|
|
TEST(Extend, ShapeInference) {
|
2023-03-27 21:28:49 +08:00
|
|
|
Runtime runtime = NativeCpuRuntimeObj::getInstance();
|
2022-09-29 14:52:50 +08:00
|
|
|
{
|
|
|
|
Graph g = make_ref<GraphObj>(runtime);
|
|
|
|
Tensor i = g->addTensor({2, 3, 3, 4}, DataType::Float32);
|
|
|
|
auto op = g->addOp<ExtendObj>(i, nullptr, 2, 1);
|
|
|
|
EXPECT_EQ(op->getOutput()->getDims(), (Shape{2, 3, 6, 4}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-15 16:29:28 +08:00
|
|
|
} // namespace infini
|