2022-09-09 13:43:59 +08:00
|
|
|
#include "core/graph.h"
|
|
|
|
#include "core/kernel.h"
|
|
|
|
#include "core/runtime.h"
|
|
|
|
#include "operators/element_wise.h"
|
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
|
|
|
namespace infini {
|
|
|
|
|
|
|
|
using ExpectOutput = vector<float>;
|
|
|
|
TEST(ElementWise, ShapeInference) {
|
2023-03-27 21:28:49 +08:00
|
|
|
Runtime runtime = NativeCpuRuntimeObj::getInstance();
|
2022-09-09 13:43:59 +08:00
|
|
|
{
|
|
|
|
Graph g = make_ref<GraphObj>(runtime);
|
|
|
|
Tensor i0 = g->addTensor({2, 3, 3, 4}, DataType::UInt32);
|
|
|
|
Tensor i1 = g->addTensor({2, 3, 3, 4}, DataType::UInt32);
|
|
|
|
auto op = g->addOp<AddObj>(i0, i1, nullptr);
|
|
|
|
EXPECT_EQ(op->getOutput()->getDims(), (Shape{2, 3, 3, 4}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-15 16:29:28 +08:00
|
|
|
} // namespace infini
|