Commit 3820725a authored by Andrew Moylan's avatar Andrew Moylan Committed by Commit Bot

Roll ML Service mojoms from Chrome OS

This CL tries out an easier flow for keeping mojoms in sync introduced
by crrev.com/c/1608980.
Specifically, this CL is exactly the following:

cd ~/chromium/src

cp ~/chromiumos/src/platform2/ml/mojom/*.mojom \
chromeos/services/machine_learning/public/mojom/

sed --in-place --regexp-extended \
's~^import "ml~import "chromeos/services/machine_learning/public~g' \
chromeos/services/machine_learning/public/mojom/*.mojom

Bug: 937063
Change-Id: Ic73a96c93cfe3422f4a7de342cfe0dad02c42f05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1609000
Commit-Queue: Andrew Moylan <amoylan@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659764}
parent 4e887537
......@@ -2,26 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// NOTE: This mojom should be kept in sync with the copy in Chromium OS's repo
// in src/platform2/ml/mojom/.
// Example: A backwards-compatible interface change can be made in Chromium OS
// first, then replicated and used here later.
// NOTE: This mojom exists in two places and must be kept in sync:
// Chromium: //chromeos/services/machine_learning/public/mojom/
// Chrome OS: src/platform2/ml/mojom/
// Example: A backwards-compatible mojom change (and corresponding
// implementation change) can be made in Chrome OS first, then replicated to the
// client (Chromium) later.
module chromeos.machine_learning.mojom;
// NOTE: The base directory for 'import' statements is expected to differ
// between Chromium and Chrome OS versions of this file.
import "chromeos/services/machine_learning/public/mojom/tensor.mojom";
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum ExecuteResult {
OK = 0,
INPUT_MISSING_ERROR,
UNKNOWN_INPUT_ERROR,
INPUT_TYPE_ERROR,
INPUT_SHAPE_ERROR,
INPUT_FORMAT_ERROR,
OUTPUT_MISSING_ERROR,
UNKNOWN_OUTPUT_ERROR,
DUPLICATE_OUTPUT_ERROR,
EXECUTION_ERROR,
INPUT_MISSING_ERROR = 1,
UNKNOWN_INPUT_ERROR = 2,
INPUT_TYPE_ERROR = 3,
INPUT_SHAPE_ERROR = 4,
INPUT_FORMAT_ERROR = 5,
OUTPUT_MISSING_ERROR = 6,
UNKNOWN_OUTPUT_ERROR = 7,
DUPLICATE_OUTPUT_ERROR = 8,
EXECUTION_ERROR = 9,
// Remove kMax and use builtin kMaxValue after Mojo uprev (crbug.com/909719).
kMax = EXECUTION_ERROR,
};
// API for performing inference on a TensorFlow graph. A given graph can be
......
......@@ -4,19 +4,27 @@
// Top-level API of the Machine Learning Service: loading models for inference.
// NOTE: This mojom should be kept in sync with the copy in Chromium OS's repo
// in src/platform2/ml/mojom/.
// Example: A backwards-compatible interface change can be made in Chromium OS
// first, then replicated and used here later.
// NOTE: This mojom exists in two places and must be kept in sync:
// Chromium: //chromeos/services/machine_learning/public/mojom/
// Chrome OS: src/platform2/ml/mojom/
// Example: A backwards-compatible mojom change (and corresponding
// implementation change) can be made in Chrome OS first, then replicated to the
// client (Chromium) later.
module chromeos.machine_learning.mojom;
// NOTE: The base directory for 'import' statements is expected to differ
// between Chromium and Chrome OS versions of this file.
import "chromeos/services/machine_learning/public/mojom/model.mojom";
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum LoadModelResult {
OK = 0,
MODEL_SPEC_ERROR,
LOAD_MODEL_ERROR,
MODEL_SPEC_ERROR = 1,
LOAD_MODEL_ERROR = 2,
// Remove kMax and use builtin kMaxValue after Mojo uprev (crbug.com/909719).
kMax = LOAD_MODEL_ERROR,
};
// Top-level interface between Chromium and the ML Service daemon.
......
......@@ -4,25 +4,35 @@
// Datatypes and interfaces of models for the Machine Learning API.
// NOTE: This mojom should be kept in sync with the copy in Chromium OS's repo
// in src/platform2/ml/mojom/.
// Example: A backwards-compatible interface change can be made in Chromium OS
// first, then replicated and used here later.
// NOTE: This mojom exists in two places and must be kept in sync:
// Chromium: //chromeos/services/machine_learning/public/mojom/
// Chrome OS: src/platform2/ml/mojom/
// Example: A backwards-compatible mojom change (and corresponding
// implementation change) can be made in Chrome OS first, then replicated to the
// client (Chromium) later.
module chromeos.machine_learning.mojom;
// NOTE: The base directory for 'import' statements is expected to differ
// between Chromium and Chrome OS versions of this file.
import "chromeos/services/machine_learning/public/mojom/graph_executor.mojom";
enum ModelId {
UNKNOWN,
TEST_MODEL, // Only available in tests.
SMART_DIM,
UNKNOWN = 0,
TEST_MODEL = 1,
SMART_DIM = 2,
// Remove kMax and use builtin kMaxValue after Mojo uprev (crbug.com/909719).
kMax = SMART_DIM,
};
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum CreateGraphExecutorResult {
OK = 0,
MODEL_INTERPRETATION_ERROR,
MEMORY_ALLOCATION_ERROR,
MODEL_INTERPRETATION_ERROR = 1,
MEMORY_ALLOCATION_ERROR = 2,
// Remove kMax and use builtin kMaxValue after Mojo uprev (crbug.com/909719).
kMax = MEMORY_ALLOCATION_ERROR,
};
struct ModelSpec {
......
......@@ -6,10 +6,12 @@
// This module is derived from the Feature proto definition of TensorFlow.
// See /tensorflow/core/example/feature.proto in the TensorFlow code.
// NOTE: This mojom should be kept in sync with the copy in Chromium OS's repo
// in src/platform2/ml/mojom/.
// Example: A backwards-compatible interface change can be made in Chromium OS
// first, then replicated and used here later.
// NOTE: This mojom exists in two places and must be kept in sync:
// Chromium: //chromeos/services/machine_learning/public/mojom/
// Chrome OS: src/platform2/ml/mojom/
// Example: A backwards-compatible mojom change (and corresponding
// implementation change) can be made in Chrome OS first, then replicated to the
// client (Chromium) later.
module chromeos.machine_learning.mojom;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment