docs.unity3d.com
    Show / Hide Table of Contents

    Read output from a model asynchronously

    After you run a model, you can read the output from a model asynchronously. This avoids Sentis blocking the main thread while it waits for the model to finish running then downloads the output data to the CPU.

    Follow these steps:

    1. Get a reference to the tensor output data using PeekOutput.
    2. Use the Tensor.AsyncReadbackRequest method and provide a callback.
    3. Sentis invokes the callback when the readback is complete. The boolean argument is true when readback was successful.
    4. Use Tensor.MakeReadable to put the downloaded data into a readable state.

    Refer to the AsyncReadback/AsyncReadbackCompute example in the sample scripts for an example.

    Additional resources

    • Tensor fundamentals
    • Use output data
    • Get output from any layer
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023