Class Global
Global settings for SiaNet library
Inheritance
System.Object
Global
Namespace: SiaNet
Assembly: SiaNet.dll
Syntax
public class Global
Properties
| Improve this Doc View SourceCurrentBackend
Get the current backend of the SiaNet. Plaese invoke Global.UseEngine method to set the backend.
Declaration
public static IBackend CurrentBackend { get; }
Property Value
Type | Description |
---|---|
IBackend | The current backend. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Invoke Global.UseEngine() function first to setup the backend and device. |
Methods
| Improve this Doc View SourceUseEngine(IBackend, DeviceType, Boolean)
Method to set the backend and device type.
Supported Engine: ArrayFire, TensorSharp, CNTK, TensorFlow, MXNet
Supported Device: CPU, CUDA, OpenCL
Example use:
Global.UseEngine(SiaNet.Backend.ArrayFire.SiaNetBackend.Instance, DeviceType.CPU);
Declaration
public static void UseEngine(IBackend backend, DeviceType deviceType = DeviceType.Default, bool cudnn = false)
Parameters
Type | Name | Description |
---|---|---|
IBackend | backend | The backend. |
DeviceType | deviceType | Type of the device. |
System.Boolean | cudnn | if set to |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | CuDnn work with CUDA device type |