// Copyright 2018 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 Machine Learning API. // 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. module chromeos.machine_learning.mojom; // Corresponds to tensorflow.BytesList protobuf: struct StringList { array value; }; // Corresponds to tensorflow.FloatList protobuf: struct FloatList { array value; }; // Corresponds to tensorflow.Int64List protobuf: struct Int64List { array value; }; // Corresponds to tensorflow.Feature protobuf: union ValueList { StringList string_list; FloatList float_list; Int64List int64_list; }; // A Tensor is a multi-dimensional array with dimensions |shape|, flattened into // the one-dimensional array |data|. // It is used for both the inputs (in the form of a map) and // outputs (in the form of an array) of ML inference. struct Tensor { ValueList data; // Each integer is the size of that dimension. Int64List shape; };