File: readme_example_main.cpp

package info (click to toggle)
frugally-deep 0.18.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,036 kB
  • sloc: cpp: 6,680; python: 1,262; makefile: 4; sh: 1
file content (18 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2016, Tobias Hermann.
// https://github.com/Dobiasd/frugally-deep
// Distributed under the MIT License.
// (See accompanying LICENSE file or at
//  https://opensource.org/licenses/MIT)

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest/doctest.h"
#include <fdeep/fdeep.hpp>

TEST_CASE("readme_example_main, main")
{
    const auto model = fdeep::load_model("../readme_example_model.json");
    const auto result = model.predict(
        { fdeep::tensor(fdeep::tensor_shape(static_cast<std::size_t>(4)),
            fdeep::float_vec { 1, 2, 3, 4 }) });
    std::cout << fdeep::show_tensors(result) << std::endl;
}