Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

关于MNN打印tensor的value的问题 #39

Open
zhuoran-guo opened this issue Jun 24, 2021 · 0 comments
Open

关于MNN打印tensor的value的问题 #39

zhuoran-guo opened this issue Jun 24, 2021 · 0 comments

Comments

@zhuoran-guo
Copy link

zhuoran-guo commented Jun 24, 2021

你好,我使用你们的repo做了benchmark,
MNN在OPENGL(2ms)下的速度是OPENCL(15ms)下的7倍,
想通过打印tensor的值来看这个测试结果是不是有bug
使用如下代码打印tensor,但是运行后却没有显示打印结果,请问你们知道如何办吗?

// Warming up...
for (int i = 0; i < warmup; ++i)
{
input->copyFromHostTensor(givenTensor.get());
net->runSession(session);
outputTensor->copyToHostTensor(expectTensor.get());
}

for (int round = 0; round < loop; round++)
{
    auto timeBegin = getTimeInUs();

    input->copyFromHostTensor(givenTensor.get());
    net->runSession(session);
    outputTensor->copyToHostTensor(expectTensor.get());

    auto timeEnd = getTimeInUs();
    //(*(expectTensor.get())).print();
    costs.push_back((timeEnd - timeBegin) / 1000.0);
}
input->copyFromHostTensor(givenTensor.get());
net->runSession(session);
outputTensor->copyToHostTensor(expectTensor.get());
(*(expectTensor.get())).print();
return costs;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant