docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Slice

    Slice<T>(T, ReadOnlySpan<int>, ReadOnlySpan<int>, ReadOnlySpan<int>, ReadOnlySpan<int>)

    Calculates an output tensor by slicing the input tensor along given axes with given starts, ends, and steps.

    Declaration
    public T Slice<T>(T X, ReadOnlySpan<int> starts, ReadOnlySpan<int> ends, ReadOnlySpan<int> axes, ReadOnlySpan<int> steps) where T : Tensor
    Parameters
    Type Name Description
    T X

    The input tensor.

    ReadOnlySpan<int> starts

    The start index along each axis.

    ReadOnlySpan<int> ends

    The end index along each axis.

    ReadOnlySpan<int> axes

    The axes along which to slice. If this is null, the layer slices all axes.

    ReadOnlySpan<int> steps

    The step values for slicing. If this is null, the layer uses step size 1 throughout.

    Returns
    Type Description
    T

    The computed output tensor.

    Type Parameters
    Name Description
    T

    The tensor type of the input and output tensors.

    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)