-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_metadata.h
40 lines (30 loc) · 1.11 KB
/
model_metadata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ML_MODEL_METADATA_H_
#define ML_MODEL_METADATA_H_
#include <map>
#include <string>
#include "ml/mojom/model.mojom.h"
namespace ml {
// The information about one supported model.
struct BuiltinModelMetadata {
chromeos::machine_learning::mojom::BuiltinModelId id;
std::string model_file;
// As accepted by the constructor of ModelImpl.
std::map<std::string, int> required_inputs;
std::map<std::string, int> required_outputs;
// Used in naming the UMA metric histograms of the model. An example of the
// names of the histograms is:
//
// MachineLearningService.`metrics_model_name`.ExecuteResult.CpuTimeMicrosec
//
// This variable must NOT be empty.
std::string metrics_model_name;
};
// Returns a map from model ID to model metdata for each supported model.
std::map<chromeos::machine_learning::mojom::BuiltinModelId,
BuiltinModelMetadata>
GetBuiltinModelMetadata();
} // namespace ml
#endif // ML_MODEL_METADATA_H_