Show / Hide Table of Contents

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 Source

CurrentBackend

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 Source

UseEngine(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 true [cudnn].

Exceptions
Type Condition
System.ArgumentException

CuDnn work with CUDA device type

  • Improve this Doc
  • View Source
Back to top Generated by DocFX