docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TestSet

    Test set loading utility

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

    Constructors

    TestSet()

    Create TestSet

    Declaration
    public TestSet()

    TestSet(JSONTestSet)

    Create with JSON test set

    Declaration
    public TestSet(JSONTestSet jsonTestSet)
    Parameters
    Type Name Description
    JSONTestSet jsonTestSet

    JSON test set

    TestSet(RawTestSet)

    Create with raw test set

    Declaration
    public TestSet(RawTestSet rawTestSet)
    Parameters
    Type Name Description
    RawTestSet rawTestSet

    raw test set

    Methods

    GetInputAsTensor(int, int, int)

    Get input as Tensor

    Declaration
    public Tensor GetInputAsTensor(int idx = 0, int batchCount = -1, int fromBatch = 0)
    Parameters
    Type Name Description
    int idx

    input index

    int batchCount

    max batch count

    int fromBatch

    start from batch

    Returns
    Type Description
    Tensor

    Tensor

    Exceptions
    Type Condition
    Exception

    thrown if called on raw test set (only JSON test set is supported)

    GetInputCount()

    Get input tensor count

    Declaration
    public int GetInputCount()
    Returns
    Type Description
    int

    GetInputData(int)

    Get input tensor data

    Declaration
    public float[] GetInputData(int idx = 0)
    Parameters
    Type Name Description
    int idx

    input tensor index

    Returns
    Type Description
    float[]

    tensor data

    GetInputName(int)

    Get input tensor name

    Declaration
    public string GetInputName(int idx = 0)
    Parameters
    Type Name Description
    int idx

    input tensor index

    Returns
    Type Description
    string

    tensor name

    GetInputShape(int)

    Get input shape

    Declaration
    public TensorShape GetInputShape(int idx = 0)
    Parameters
    Type Name Description
    int idx

    input tensor index

    Returns
    Type Description
    TensorShape

    input shape

    GetInputsAsTensorDictionary(Dictionary<string, Tensor>, int, int)

    Get inputs as Tensor dictionary

    Declaration
    public Dictionary<string, Tensor> GetInputsAsTensorDictionary(Dictionary<string, Tensor> inputs = null, int batchCount = -1, int fromBatch = 0)
    Parameters
    Type Name Description
    Dictionary<string, Tensor> inputs

    dictionary to store results

    int batchCount

    max batch count

    int fromBatch

    start from batch

    Returns
    Type Description
    Dictionary<string, Tensor>

    dictionary with input tensors

    Exceptions
    Type Condition
    Exception

    thrown if called on raw test set (only JSON test set is supported)

    GetOutputAsTensor(int, int, int)

    Get output as Tensor

    Declaration
    public Tensor GetOutputAsTensor(int idx = 0, int batchCount = -1, int fromBatch = 0)
    Parameters
    Type Name Description
    int idx

    output index

    int batchCount

    max batch count

    int fromBatch

    start from batch

    Returns
    Type Description
    Tensor

    Tensor

    Exceptions
    Type Condition
    Exception

    thrown if called on raw test set (only JSON test set is supported)

    GetOutputCount()

    Get output tensor count

    Declaration
    public int GetOutputCount()
    Returns
    Type Description
    int

    GetOutputData(int)

    Get output tensor data

    Declaration
    public float[] GetOutputData(int idx = 0)
    Parameters
    Type Name Description
    int idx

    tensor index

    Returns
    Type Description
    float[]

    tensor data

    GetOutputName(int)

    Get output tensor name

    Declaration
    public string GetOutputName(int idx = 0)
    Parameters
    Type Name Description
    int idx

    tensor index

    Returns
    Type Description
    string

    tensor name

    GetOutputShape(int)

    Get output tensor shape

    Declaration
    public TensorShape GetOutputShape(int idx = 0)
    Parameters
    Type Name Description
    int idx

    output tensor index

    Returns
    Type Description
    TensorShape

    tensor shape

    GetOutputsAsTensorDictionary(Dictionary<string, Tensor>, int, int)

    Get outputs as Tensor dictionary

    Declaration
    public Dictionary<string, Tensor> GetOutputsAsTensorDictionary(Dictionary<string, Tensor> outputs = null, int batchCount = -1, int fromBatch = 0)
    Parameters
    Type Name Description
    Dictionary<string, Tensor> outputs

    dictionary to store results

    int batchCount

    max batch count

    int fromBatch

    start from batch

    Returns
    Type Description
    Dictionary<string, Tensor>

    dictionary with input tensors

    Exceptions
    Type Condition
    Exception

    thrown if called on raw test set (only JSON test set is supported)

    SupportsNames()

    Check if test set supports named tensors

    Declaration
    public bool SupportsNames()
    Returns
    Type Description
    bool

    true if named tensors are supported

    Extension Methods

    DeprecatedTestSetExtensions.GetInputShape(TestSet, int)
    DeprecatedTestSetExtensions.GetOutputShape(TestSet, int)
    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)