#include "core/graph.h" #include "core/kernel.h" #include "core/runtime.h" #include "operators/unary.h" #include "test.h" namespace infini { template void testClip(const std::function &generator, const Shape &shape) { // Runtime Runtime cpuRuntime = NativeCpuRuntimeObj::getInstance(); // Build input data on CPU Tensor inputCpu = make_ref(shape, DataType::Float32, cpuRuntime); // GPU Graph Graph = make_ref(cpuRuntime); float min = 1.0; float max = 4.0; auto Op = Graph->addOp(inputCpu, nullptr, min, max); Graph->addTensor(inputCpu); Graph->dataMalloc(); inputCpu->setData(generator); cpuRuntime->run(Graph); auto output = Op->getOutput(); inputCpu->printData(); output->printData(); EXPECT_TRUE(1); } TEST(cnnl_Clip, run) { testClip(IncrementalGenerator(), Shape{1, 2, 2, 3}); } } // namespace infini