summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f55d87)
raw | patch | inline | side by side (parent: 3f55d87)
author | Michael Butler <butlermichael@google.com> | |
Tue, 19 Sep 2017 23:26:47 +0000 (16:26 -0700) | ||
committer | Michael Butler <butlermichael@google.com> | |
Fri, 22 Sep 2017 22:53:03 +0000 (15:53 -0700) |
Additionally cleaned up some comments and formatting.
Bug: 63905942
Test: not needed
Change-Id: I0306f6d37f3c9ce9b365b5f838c27e81fa001ccd
Bug: 63905942
Test: not needed
Change-Id: I0306f6d37f3c9ce9b365b5f838c27e81fa001ccd
index b6f94330a29ecaecf54a63dd6304bf3d2c429396..91a9555b6d56a21484c1332681ae0d552c259fdf 100644 (file)
* limitations under the License.
*/
-/* This HAL is a work in progress */
-
package android.hardware.neuralnetworks@1.0;
import IEvent;
/**
* Gets the capabilities of a driver.
*
- * @return status ErrorStatus::NONE if successful.
+ * @return status Error status of the call, must be:
+ * - NONE if successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if there is an unspecified error
* @return capabilities Capabilities of the driver.
*/
getCapabilities() generates (ErrorStatus status, Capabilities capabilities);
*
* @param model A model whose operations--and their corresponding
* operands--are to be verified by the driver.
- * @return status ErrorStatus::NONE if successful.
+ * @return status Error status of the call, must be:
+ * - NONE if successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if there is an unspecified error
+ * - INVALID_ARGUMENT when provided model is invalid
* @return supportedOperations A list of supported operations, where true
* indicates the operation is supported and
* false indicates the operation is not
* it is describing.
*/
getSupportedOperations(Model model)
- generates (ErrorStatus status, vec<bool> supportedOperations);
+ generates (ErrorStatus status, vec<bool> supportedOperations);
/**
* Prepares a model for execution.
* prepareModel is used to make any necessary transformations or alternative
* representations to a model for execution, possible including
* transformations on the constant data, optimization on the model's graph,
- * or compilation into the device's native binary.
+ * or compilation into the device's native binary format.
*
* The only information that may be unknown to the model at this stage is
* the shape of the tensors, which may only be known at execution time.
* @param model The model to be prepared for execution.
* @param event A synchronization callback that must be signaled once the
* execution has finished.
- * @return status ErrorStatus::NONE if successful.
+ * @return status Error status of the call, must be:
+ * - NONE if preparation task is successfully launched
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if there is an unspecified error
+ * - INVALID_ARGUMENT when one of the input arguments is
+ * invalid
* @return preparedModel A handle to the resultant prepared model.
*/
prepareModel(Model model, IEvent event)
- generates (ErrorStatus status, IPreparedModel preparedModel);
+ generates (ErrorStatus status, IPreparedModel preparedModel);
/**
* Returns the current status of a driver.
*
- * @return status Status of the driver.
+ * @return status Status of the driver, one of:
+ * - DeviceStatus::AVAILABLE
+ * - DeviceStatus::BUSY
+ * - DeviceStatus::OFFLINE
+ * - DeviceStatus::UNKNOWN
*/
getStatus() generates (DeviceStatus status);
};
index 2ebda58948b102903ab530349f2202340acb842e..2fe454c1cd5496b2e3a6a0296b808c30ab7fa5a2 100644 (file)
* limitations under the License.
*/
-/* This HAL is a work in progress */
-
package android.hardware.neuralnetworks@1.0;
/**
* the work) to mark the event as completed so that any threads requiring
* the corresponding output can continue executing.
*
- * @param status ErrorStatus::NONE if successful.
+ * @param status Error status returned from the asynchronous task, must be:
+ * - NONE if asynchronous task was successful
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if the asynchronous task resulted in an
+ * unspecified error
*/
oneway notify(ErrorStatus status);
};
index a7c33420932c09435e6ab4b5f302d13041fb5e69..5df883e1d2b3fabdbd906a41df4af3867046bdec 100644 (file)
*
* @param request The input and output information on which the prepared
* model is to be executed.
- * prepared model.
* @param event A callback used for synchronization that must be signaled
* once the execution has finished.
- * @return status ErrorStatus::NONE if the asynchronous task was
- * successfully launched.
+ * @return status Error status of the call, must be:
+ * - NONE if task is successfully launched
+ * - DEVICE_UNAVAILABLE if driver is offline or busy
+ * - GENERAL_FAILURE if there is an unspecified error
+ * - OUTPUT_INSUFFICIENT_SIZE if provided output buffer is
+ * not large enough to store the resultant values
+ * - INVALID_ARGUMENT when one of the input arguments is
+ * invalid
*/
execute(Request request, IEvent event) generates (ErrorStatus status);
};
index 39e3d345c07d7e3aa8f29bb51c0e8104dd312a6f..537331bb88167d940a98da6d3073cfb1d542283d 100644 (file)
*
* Inputs:
* 0: A 4-D tensor, of shape [batches, height, width, depth_in], specifying the input.
- * 1: A 4-D tensor, of shape [depth_out, filter_height, filter_width, depth_in],
+ * 1: A 4-D tensor, of shape [1, filter_height, filter_width, depth_out],
* specifying the filter.
* 2: A 1-D tensor, of shape [depth_out], specifying the bias.
* For input tensor of {@link OperandType::TENSOR_FLOAT32} type, the bias should
/**
* Quantized scale of the operand.
*
- * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
+ * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
+ * TENSOR_INT32.
*/
float scale;
/**
* Quantized zero-point offset of the operand.
*
- * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
+ * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
+ * TENSOR_INT32.
*/
int32_t zeroPoint;
/**
* A byte buffer containing operand data that were copied into the model.
+ *
+ * An operand's value must be located here if and only if Operand::lifetime
+ * equals OperandLifeTime::CONSTANT_COPY.
*/
vec<uint8_t> operandValues;
/**
* A collection of shared memory pools containing operand data that were
* registered by the model.
+ *
+ * An operand's value must be located here if and only if Operand::lifetime
+ * equals OperandLifeTime::CONSTANT_REFERENCE.
*/
vec<memory> pools;
};