docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Layer

    Barracuda Model Layer

    Inheritance
    object
    Layer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Barracuda
    Assembly: Unity.Barracuda.dll
    Syntax
    public class Layer

    Constructors

    Layer(string, Activation)

    Constructs Activation Layer

    Declaration
    public Layer(string layerName, Layer.Activation activationType)
    Parameters
    Type Name Description
    string layerName

    layer name

    Layer.Activation activationType

    layer activation type

    Layer(string, Type, Activation)

    Constructs Layer

    Declaration
    public Layer(string layerName, Layer.Type layerType, Layer.Activation activationType = Activation.None)
    Parameters
    Type Name Description
    string layerName

    layer name

    Layer.Type layerType

    layer type

    Layer.Activation activationType

    layer activation type

    Fields

    activation

    Layer activation type

    Declaration
    public Layer.Activation activation
    Field Value
    Type Description
    Layer.Activation

    alpha

    Alpha

    Declaration
    public float alpha
    Field Value
    Type Description
    float

    axes

    Axes (not serialized) - used for conversion

    Declaration
    [NonSerialized]
    public int[] axes
    Field Value
    Type Description
    int[]

    axis

    Axis

    Declaration
    public int axis
    Field Value
    Type Description
    int

    beta

    Beta

    Declaration
    public float beta
    Field Value
    Type Description
    float

    datasets

    Datasets bound to layer

    Declaration
    public Layer.DataSet[] datasets
    Field Value
    Type Description
    DataSet[]

    flags

    Layer flags (not serialized) - used for conversion

    Declaration
    [NonSerialized]
    public Layer.Flags flags
    Field Value
    Type Description
    Layer.Flags

    inputs

    Input (layer) names

    Declaration
    public string[] inputs
    Field Value
    Type Description
    string[]

    name

    Layer name

    Declaration
    public string name
    Field Value
    Type Description
    string

    outputs

    Output (layer) names (not serialized) - used for conversion

    Declaration
    [NonSerialized]
    public string[] outputs
    Field Value
    Type Description
    string[]

    pad

    Padding shape

    Declaration
    public int[] pad
    Field Value
    Type Description
    int[]

    pool

    Pooling

    Declaration
    public int[] pool
    Field Value
    Type Description
    int[]

    stride

    Stride

    Declaration
    public int[] stride
    Field Value
    Type Description
    int[]

    type

    Layer type

    Declaration
    public Layer.Type type
    Field Value
    Type Description
    Layer.Type

    weights

    Flat weights array (for actual shape see datasets)

    Declaration
    public float[] weights
    Field Value
    Type Description
    float[]

    Methods

    ApplyTensorToDataSet(Tensor, int)

    Converts Tensor to DataSet

    Declaration
    public void ApplyTensorToDataSet(Tensor X, int index)
    Parameters
    Type Name Description
    Tensor X

    input Tensor

    int index

    dataset index

    DataSetToTensor(int)

    Converts DataSet to Tensor

    Declaration
    public Tensor DataSetToTensor(int index)
    Parameters
    Type Name Description
    int index

    dataset index

    Returns
    Type Description
    Tensor

    Tensor

    ToString()

    Layer summary string

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    layer summary string

    Overrides
    object.ToString()
    In This Article
    Back to top
    Copyright © 2025 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)