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

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

@zhuoran-guo

Description

@zhuoran-guo

你好,我使用你们的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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions