blob: 27491b972efe8b0998be0179e4823d853351faa4 [file] [log] [blame]
// Copyright 2020 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.
syntax = "proto3";
package ml;
// TfliteBenchmarkConfig contains configurations used for tflite benchmarking.
message TfliteBenchmarkConfig {
// The path on the device to load the tflite_model.
string tflite_model_filepath = 1;
// The path on the device to load the expected input output.
string input_output_filepath = 2;
// number of times to test each input file
int32 num_runs = 3;
}
// FlatBufferModelSpecProto contains full information of a tflite model.
message FlatBufferModelSpecProto {
// The content of the flatbuffer of the model.
bytes model_string = 1;
// tflite node specification need to reconstruct the tensor.
message NodeSpec {
// The index of this node in the tflite interpreter.
int32 index = 1;
// The dims for re-constructing the tensor shape.
repeated int32 dims = 2;
}
// As accepted by the constructor of ModelImpl.
map<string, NodeSpec> required_inputs = 2;
map<string, NodeSpec> required_outputs = 3;
}
// ExpectedInputOutput contains input and expected_output for benchmarking.
message ExpectedInputOutput {
// A copy of tensorflow Example definition is defined here temporarily, this
// should be replaced by tensorflow::Example when it is available.
message Example {
// Containers to hold repeated fundamental values.
message BytesList { repeated bytes value = 1; }
message FloatList { repeated float value = 1 [packed = true]; }
message Int64List { repeated int64 value = 1 [packed = true]; }
// Containers for the data type.
message Feature {
// Each feature can be exactly one kind.
oneof kind {
BytesList bytes_list = 1;
FloatList float_list = 2;
Int64List int64_list = 3;
}
}
message Features {
// Map from feature name to feature.
map<string, Feature> feature = 1;
}
Features features = 1;
}
// Input Example to test.
Example input = 1;
// Expected output.
Example expected_output = 2;
}