docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Cast

    Cast(Tensor, DataType)

    Computes the output tensor using an element-wise Cast function: f(x) = (float)x or f(x) = (int)x depending on the value of toType.

    Declaration
    public Tensor Cast(Tensor X, DataType toType)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    DataType toType

    The data type to cast to as a DataType.

    Returns
    Type Description
    Tensor

    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)