Class TestSet
Test set loading utility
Namespace: Unity.Barracuda
Syntax
public class TestSet : object
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(Int32, Int32, Int32)
Get input as Tensor
Declaration
public Tensor GetInputAsTensor(int idx = 0, int batchCount = null, int fromBatch = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | input index |
Int32 | batchCount | max batch count |
Int32 | fromBatch | start from batch |
Returns
Type | Description |
---|---|
Tensor |
|
GetInputCount()
Get input tensor count
Declaration
public int GetInputCount()
Returns
Type | Description |
---|---|
Int32 |
GetInputData(Int32)
Get input tensor data
Declaration
public float[] GetInputData(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | input tensor index |
Returns
Type | Description |
---|---|
Single[] | tensor data |
GetInputName(Int32)
Get input tensor name
Declaration
public string GetInputName(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | input tensor index |
Returns
Type | Description |
---|---|
String | tensor name |
GetInputsAsTensorDictionary(Dictionary<String, Tensor>, Int32, Int32)
Get inputs as Tensor
dictionary
Declaration
public Dictionary<string, Tensor> GetInputsAsTensorDictionary(Dictionary<string, Tensor> inputs = null, int batchCount = null, int fromBatch = 0)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<String, Tensor> | inputs | dictionary to store results |
Int32 | batchCount | max batch count |
Int32 | fromBatch | start from batch |
Returns
Type | Description |
---|---|
Dictionary<String, Tensor> | dictionary with input tensors |
GetInputShape(Int32)
Get input shape
Declaration
public TensorShape GetInputShape(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | input tensor index |
Returns
Type | Description |
---|---|
TensorShape | input shape |
GetOutputAsTensor(Int32, Int32, Int32)
Get output as Tensor
Declaration
public Tensor GetOutputAsTensor(int idx = 0, int batchCount = null, int fromBatch = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | output index |
Int32 | batchCount | max batch count |
Int32 | fromBatch | start from batch |
Returns
Type | Description |
---|---|
Tensor |
|
GetOutputCount()
Get output tensor count
Declaration
public int GetOutputCount()
Returns
Type | Description |
---|---|
Int32 |
GetOutputData(Int32)
Get output tensor data
Declaration
public float[] GetOutputData(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | tensor index |
Returns
Type | Description |
---|---|
Single[] | tensor data |
GetOutputName(Int32)
Get output tensor name
Declaration
public string GetOutputName(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | tensor index |
Returns
Type | Description |
---|---|
String | tensor name |
GetOutputsAsTensorDictionary(Dictionary<String, Tensor>, Int32, Int32)
Get outputs as Tensor
dictionary
Declaration
public Dictionary<string, Tensor> GetOutputsAsTensorDictionary(Dictionary<string, Tensor> outputs = null, int batchCount = null, int fromBatch = 0)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<String, Tensor> | outputs | dictionary to store results |
Int32 | batchCount | max batch count |
Int32 | fromBatch | start from batch |
Returns
Type | Description |
---|---|
Dictionary<String, Tensor> | dictionary with input tensors |
GetOutputShape(Int32)
Get output tensor shape
Declaration
public TensorShape GetOutputShape(int idx = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | idx | output tensor index |
Returns
Type | Description |
---|---|
TensorShape | tensor shape |
SupportsNames()
Check if test set supports named tensors
Declaration
public bool SupportsNames()
Returns
Type | Description |
---|---|
Boolean |
|