docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method OneHot

    OneHot(TensorInt, int, int, int, int)

    Generates a one-hot tensor with a given depth, indices and on and off values.

    Declaration
    public TensorInt OneHot(TensorInt indices, int axis, int depth, int offValue, int onValue)
    Parameters
    Type Name Description
    TensorInt indices

    The indices input tensor.

    int axis

    The axis along which the operation adds the one-hot representation.

    int depth

    The depth of the one-hot tensor.

    int offValue

    The value to use for an off element.

    int onValue

    The value to use for an on element.

    Returns
    Type Description
    TensorInt

    The computed output tensor.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)