| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Datatypes used in the Federated Service API. |
| // This module is derived from the Feature and Example proto definition of |
| // TensorFlow. See /tensorflow/core/example/feature.proto and |
| // /tensorflow/core/example/example.proto in the TensorFlow code. |
| // StringList, FloatList, Int64List and ValueList are same to tensor.mojom in |
| // platform2/ml/mojom. |
| |
| // NOTE: This mojom should exist in two places and must be kept in sync: |
| // Chromium: TODO path |
| // Chrome OS: src/platform2/federated/mojom/ |
| // Note: Other repos downstream of Chromium might also use this mojom. |
| // Example: A backwards-compatible mojom change (and corresponding |
| // implementation change) can be made in Chrome OS first, then replicated to the |
| // clients (Chromium, other downstream repos) later. |
| // TODO config a sync tool for federated mojo files. |
| // Use //chromeos/services/machine_learning/public/mojom/roll_mojom.sh to help |
| // replicate Chrome OS-side changes over to Chromium. |
| |
| module chromeos.federated.mojom; |
| |
| struct StringList { |
| array<string> value; |
| }; |
| |
| struct FloatList { |
| array<double> value; |
| }; |
| |
| struct Int64List { |
| array<int64> value; |
| }; |
| |
| // The union of all supported value types. |
| union ValueList { |
| StringList string_list; |
| FloatList float_list; |
| Int64List int64_list; |
| }; |
| |
| // The mirror of tensorflow::Features. |
| struct Features { |
| // Map from feature name to feature. |
| map<string, ValueList> feature; |
| }; |
| |
| // The mirror of tensorflow::Example. |
| struct Example { |
| Features features; |
| }; |