stub_inference_engine.xpp 771 Bytes
Newer Older
openvino-pushbot's avatar
openvino-pushbot committed
1 2 3
// Copyright (C) 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
4

openvino-pushbot's avatar
openvino-pushbot committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#include <random>
#include <algorithm>

#include "stub_inference_engine.hpp"

using namespace InferenceEngine;
using namespace std;

void StubInferenceEngine::Infere(const Blob &input, Blob & output) {
    unsigned int batchNumber = input.dims().size() > 3 ? input.dims()[3] : 1;
    auto &outBlob = dynamic_cast<TBlob<float>&>(output);
    outBlob.Resize({ 1000, batchNumber });
    outBlob.allocate();
    
    //uniform distribution in 0-1 range
    random_device rd;
    mt19937 mersen(rd());
    uniform_real_distribution<float> uniformDistribution(0 , 1);
    generate(outBlob.data(), outBlob.data() + outBlob.size(), [&] () {
        return uniformDistribution(mersen);
    });
}