1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.hardware.neuralnetworks; 18 19 import android.hardware.neuralnetworks.RequestArgument; 20 import android.hardware.neuralnetworks.RequestMemoryPool; 21 22 /** 23 * Inputs to be sent to and outputs to be retrieved from a prepared model. 24 * 25 * A Request serves two primary tasks: 26 * 1) Provides the input and output data to be used when executing the model. 27 * 2) Specifies any updates to the input operand metadata that were left unspecified at model 28 * preparation time. 29 * 30 * An output must not overlap with any other output, with an input, or with an operand of lifetime 31 * CONSTANT_POOL. 32 */ 33 @VintfStability 34 parcelable Request { 35 /** 36 * Input data and information to be used in the execution of a prepared model. 37 * 38 * The index of the input corresponds to the index in Model.main.inputIndexes. 39 * E.g., input[i] corresponds to Model.main.inputIndexes[i]. 40 */ 41 RequestArgument[] inputs; 42 /** 43 * Output data and information to be used in the execution of a prepared model. 44 * 45 * The index of the output corresponds to the index in Model.main.outputIndexes. 46 * E.g., output[i] corresponds to Model.main.outputIndexes[i]. 47 */ 48 RequestArgument[] outputs; 49 /** 50 * A collection of memory pools containing operand data for both the inputs and the outputs to a 51 * model. 52 */ 53 RequestMemoryPool[] pools; 54 } 55