Interface IBackend
Assembly: SiaNet.Engine.dll
Syntax
public interface IBackend
Methods
|
Improve this Doc
View Source
Abs(Tensor)
Return the absolute value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Acos(Tensor)
Calculate the invert cos value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Add(Tensor, Tensor)
Declaration
Tensor Add(Tensor a, Tensor b)
Parameters
Returns
|
Improve this Doc
View Source
Add(Tensor, Single)
Adds Tensor and float value
Declaration
Tensor Add(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float Value
|
Returns
|
Improve this Doc
View Source
Add(Single, Tensor)
Declaration
Tensor Add(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value
|
Tensor |
b |
Tensor data
|
Returns
|
Improve this Doc
View Source
Argmax(Tensor, Int32)
Declaration
Tensor Argmax(Tensor x, int dim = 0)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
dim |
|
Returns
|
Improve this Doc
View Source
Argmin(Tensor, Int32)
Declaration
Tensor Argmin(Tensor x, int dim = 0)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
dim |
|
Returns
|
Improve this Doc
View Source
Asin(Tensor)
Calculate the invert sign value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Atan(Tensor)
Calculate the invert tan value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Ceil(Tensor)
Calculate the ceil value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Clip(Tensor, Single, Single)
Clips the specified tensor between min and max value, elemen-wise.
Declaration
Tensor Clip(Tensor x, float min, float max)
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor data.
|
System.Single |
min |
The minimum value.
|
System.Single |
max |
The maximum value.
|
Returns
|
Improve this Doc
View Source
Col2Im(Tensor, Int64[], Tuple<Int32, Int32>, Int32, Int32)
Declaration
Tensor Col2Im(Tensor cols, long[] x_shape, Tuple<int, int> kernalSize, int padding = 1, int stride = 1)
Parameters
Type |
Name |
Description |
Tensor |
cols |
|
System.Int64[] |
x_shape |
|
System.Tuple<System.Int32, System.Int32> |
kernalSize |
|
System.Int32 |
padding |
|
System.Int32 |
stride |
|
Returns
|
Improve this Doc
View Source
Constant(Single, Int64[])
Create a constant variable with specified value and target tensor shape
Declaration
Tensor Constant(float value, long[] shape)
Parameters
Type |
Name |
Description |
System.Single |
value |
The value.
|
System.Int64[] |
shape |
The shape.
|
Returns
|
Improve this Doc
View Source
Cos(Tensor)
Calculate the cos value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Cosh(Tensor)
Calculate the hyperbolic cos value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
CreateVariable(Single[], Int64[], String)
Declaration
Tensor CreateVariable(float[] data, long[] shape, string name = "")
Parameters
Type |
Name |
Description |
System.Single[] |
data |
The data.
|
System.Int64[] |
shape |
The shape.
|
System.String |
name |
The name.
|
Returns
|
Improve this Doc
View Source
Diag(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
|
Improve this Doc
View Source
Dispose(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
|
Improve this Doc
View Source
Div(Tensor, Tensor)
Declaration
Tensor Div(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor.
|
Tensor |
b |
Second tensor.
|
Returns
|
Improve this Doc
View Source
Div(Tensor, Single)
Declaration
Tensor Div(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data.
|
System.Single |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
Div(Single, Tensor)
Declaration
Tensor Div(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value.
|
Tensor |
b |
Tensor data.
|
Returns
|
Improve this Doc
View Source
Dot(Tensor, Tensor)
Declaration
Tensor Dot(Tensor a, Tensor b)
Parameters
Returns
|
Improve this Doc
View Source
Epsilon()
Epsilon which is the smallest float value and > 0
Declaration
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
EqualTo(Tensor, Tensor)
Check if two tensor are equal
Declaration
Tensor EqualTo(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor.
|
Tensor |
b |
Second Tensor.
|
Returns
|
Improve this Doc
View Source
Eval(Tensor)
Evals the specified tensor.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The x.
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
Exp(Tensor)
Return the exponential value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Floor(Tensor)
Calculate the floor value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
GetActFunc()
Declaration
ActivationFunc GetActFunc()
Returns
Type |
Description |
SiaNet.Engine.Layers.ActivationFunc |
|
|
Improve this Doc
View Source
GetArray(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
Type |
Description |
System.Array |
|
|
Improve this Doc
View Source
GetDataType(Tensor)
Gets the type of the data.
Declaration
DataType GetDataType(Tensor x)
Parameters
Type |
Name |
Description |
Tensor |
x |
The x.
|
Returns
|
Improve this Doc
View Source
GetShape(Tensor)
Gets the shape of the tensor.
Declaration
long[] GetShape(Tensor x)
Parameters
Type |
Name |
Description |
Tensor |
x |
The x.
|
Returns
Type |
Description |
System.Int64[] |
|
|
Improve this Doc
View Source
GreaterThan(Tensor, Tensor)
Perform a > b between two tensor
Declaration
Tensor GreaterThan(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor
|
Tensor |
b |
Second tensor.
|
Returns
|
Improve this Doc
View Source
GreaterThan(Tensor, Single)
Perform a > b between tensor and float
Declaration
Tensor GreaterThan(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
GreaterThan(Single, Tensor)
Perform a > b between float and tensor
Declaration
Tensor GreaterThan(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value
|
Tensor |
b |
Tensor data.
|
Returns
|
Improve this Doc
View Source
GreaterThanEqual(Tensor, Tensor)
Perform a >= b between two tensor
Declaration
Tensor GreaterThanEqual(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor
|
Tensor |
b |
Second tensor.
|
Returns
|
Improve this Doc
View Source
GreaterThanEqual(Tensor, Single)
Perform a >= b between tensor and float
Declaration
Tensor GreaterThanEqual(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
GreaterThanEqual(Single, Tensor)
Perform a >= b between float and tensor
Declaration
Tensor GreaterThanEqual(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value
|
Tensor |
b |
Tensor data.
|
Returns
|
Improve this Doc
View Source
Im2Col(Tensor, Tuple<Int32, Int32>, Int32, Int32)
Declaration
Tensor Im2Col(Tensor x, Tuple<int, int> kernalSize, int padding = 1, int stride = 1)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Tuple<System.Int32, System.Int32> |
kernalSize |
|
System.Int32 |
padding |
|
System.Int32 |
stride |
|
Returns
|
Improve this Doc
View Source
L2Normalize(Tensor, Int32)
Declaration
Tensor L2Normalize(Tensor x, int axis = -1)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
axis |
|
Returns
|
Improve this Doc
View Source
LessThan(Tensor, Tensor)
Perform a < b between two tensor
Declaration
Tensor LessThan(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor
|
Tensor |
b |
Second tensor.
|
Returns
|
Improve this Doc
View Source
LessThan(Tensor, Single)
Perform a < b between tensor and float
Declaration
Tensor LessThan(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
LessThan(Single, Tensor)
Perform a < b between float and Tensor
Declaration
Tensor LessThan(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Floaty value
|
Tensor |
b |
Tensor data.
|
Returns
|
Improve this Doc
View Source
LessThanEqual(Tensor, Tensor)
Perform a <= b between two tensor
Declaration
Tensor LessThanEqual(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor
|
Tensor |
b |
Second tensor.
|
Returns
|
Improve this Doc
View Source
LessThanEqual(Tensor, Single)
Perform a <= b between tensor and float
Declaration
Tensor LessThanEqual(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
LessThanEqual(Single, Tensor)
Perform a <= b between float and Tensor
Declaration
Tensor LessThanEqual(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Tensor data
|
Tensor |
b |
Float value.
|
Returns
|
Improve this Doc
View Source
Log(Tensor)
Calculate the logrithmic value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Log10(Tensor)
Return the base 10 logarithm of the input array, element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Log1p(Tensor)
Return the natural logarithm of one plus the input array, element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Max(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Max(Tensor, Int32)
Declaration
Tensor Max(Tensor x, int dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
dim |
|
Returns
|
Improve this Doc
View Source
Max(Tensor, Int32[])
Declaration
Tensor Max(Tensor x, params int[] dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32[] |
dim |
|
Returns
|
Improve this Doc
View Source
Maximum(Tensor, Tensor)
Declaration
Tensor Maximum(Tensor a, Tensor b)
Parameters
Returns
|
Improve this Doc
View Source
Maximum(Tensor, Single)
Declaration
Tensor Maximum(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
|
System.Single |
b |
|
Returns
|
Improve this Doc
View Source
Mean(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Mean(Tensor, Int32)
Declaration
Tensor Mean(Tensor x, int dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
dim |
|
Returns
|
Improve this Doc
View Source
Mean(Tensor, Int32[])
Declaration
Tensor Mean(Tensor x, params int[] dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32[] |
dim |
|
Returns
|
Improve this Doc
View Source
Min(Tensor)
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Min(Tensor, Int32)
Declaration
Tensor Min(Tensor x, int dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
dim |
|
Returns
|
Improve this Doc
View Source
Min(Tensor, Int32[])
Declaration
Tensor Min(Tensor x, params int[] dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32[] |
dim |
|
Returns
|
Improve this Doc
View Source
Minimum(Tensor, Tensor)
Declaration
Tensor Minimum(Tensor a, Tensor b)
Parameters
Returns
|
Improve this Doc
View Source
Minimum(Tensor, Single)
Declaration
Tensor Minimum(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
|
System.Single |
b |
|
Returns
|
Improve this Doc
View Source
Mul(Tensor, Tensor)
Declaration
Tensor Mul(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First tensor
|
Tensor |
b |
Second tensor
|
Returns
|
Improve this Doc
View Source
Mul(Tensor, Single)
Multiply tensor and float
Declaration
Tensor Mul(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data.
|
System.Single |
b |
Float value
|
Returns
|
Improve this Doc
View Source
Mul(Single, Tensor)
Multiply float and tensor
Declaration
Tensor Mul(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value.
|
Tensor |
b |
Tensor data.
|
Returns
|
Improve this Doc
View Source
Neg(Tensor)
Negate the value element-wise
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Pow(Tensor, Single)
Power up the specified tensor.
Declaration
Tensor Pow(Tensor x, float value)
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
System.Single |
value |
The power up value.
|
Returns
|
Improve this Doc
View Source
Print(Tensor, String)
Prints the specified tensor for observation.
Declaration
void Print(Tensor x, string title = "")
Parameters
Type |
Name |
Description |
Tensor |
x |
The x.
|
System.String |
title |
The title.
|
|
Improve this Doc
View Source
RandomBernoulli(Int64[], Single)
Generate variable with Randon Bernoulli distribution
Declaration
Tensor RandomBernoulli(long[] shape, float p)
Parameters
Type |
Name |
Description |
System.Int64[] |
shape |
The shape.
|
System.Single |
p |
The probability value
|
Returns
|
Improve this Doc
View Source
RandomNormal(Int64[], Single, Single, Nullable<Int32>)
Generate variable with Randon Normal distribution data
Declaration
Tensor RandomNormal(long[] shape, float mean, float stddev, int? seed = default(int? ))
Parameters
Type |
Name |
Description |
System.Int64[] |
shape |
The shape.
|
System.Single |
mean |
The mean.
|
System.Single |
stddev |
The stddev.
|
System.Nullable<System.Int32> |
seed |
The seed.
|
Returns
|
Improve this Doc
View Source
Generate variable with Randon Uniform distribution data
Declaration
Tensor RandomUniform(long[] shape, float min, float max, int? seed = default(int? ))
Parameters
Type |
Name |
Description |
System.Int64[] |
shape |
The shape.
|
System.Single |
min |
The minimum.
|
System.Single |
max |
The maximum.
|
System.Nullable<System.Int32> |
seed |
The seed.
|
Returns
|
Improve this Doc
View Source
Reshape(Tensor, Int64[])
Reshapes the specified x.
Declaration
Tensor Reshape(Tensor x, params long[] shape)
Parameters
Type |
Name |
Description |
Tensor |
x |
The x.
|
System.Int64[] |
shape |
The shape.
|
Returns
|
Improve this Doc
View Source
Round(Tensor)
Calculate the rounded to nearest integer value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
SetDevice(DeviceType)
Sets the device CPU, GPU or OpenCL.
Declaration
void SetDevice(DeviceType device)
Parameters
Type |
Name |
Description |
DeviceType |
device |
The device.
|
|
Improve this Doc
View Source
Sigmoid(Tensor)
Calculate the sigmoid value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Sin(Tensor)
Calculate the sin value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Sinh(Tensor)
Calculate the hyperbolic sin value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
SliceCols(Tensor, Int64, Int64)
Declaration
Tensor SliceCols(Tensor x, long start, long end)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int64 |
start |
|
System.Int64 |
end |
|
Returns
|
Improve this Doc
View Source
SliceRows(Tensor, Int64, Int64)
Declaration
Tensor SliceRows(Tensor x, long start, long end)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int64 |
start |
|
System.Int64 |
end |
|
Returns
|
Improve this Doc
View Source
Softmax(Tensor, Int32)
Declaration
Tensor Softmax(Tensor x, int axis = -1)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
axis |
|
Returns
|
Improve this Doc
View Source
Softplus(Tensor, Int32)
Declaration
Tensor Softplus(Tensor x, int axis = -1)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32 |
axis |
|
Returns
|
Improve this Doc
View Source
Sqrt(Tensor)
Return the square root value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Square(Tensor)
Calculate the square of tensor element-wise
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Sub(Tensor, Tensor)
Declaration
Tensor Sub(Tensor a, Tensor b)
Parameters
Type |
Name |
Description |
Tensor |
a |
First Tensor
|
Tensor |
b |
Second Tensor
|
Returns
|
Improve this Doc
View Source
Sub(Tensor, Single)
Subtract tensor and float
Declaration
Tensor Sub(Tensor a, float b)
Parameters
Type |
Name |
Description |
Tensor |
a |
Tensor data
|
System.Single |
b |
Float value
|
Returns
|
Improve this Doc
View Source
Sub(Single, Tensor)
Subtract float and tensor
Declaration
Tensor Sub(float a, Tensor b)
Parameters
Type |
Name |
Description |
System.Single |
a |
Float value
|
Tensor |
b |
Tensor data
|
Returns
|
Improve this Doc
View Source
Sum(Tensor)
Sum of array elements overall axis
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Sum(Tensor, Int32)
Sum of array elements over a given axis.
Declaration
Tensor Sum(Tensor x, int dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
System.Int32 |
dim |
The dim to reduce.
|
Returns
|
Improve this Doc
View Source
Sum(Tensor, Int32[])
Sum of array elements over multiple axis.
Declaration
Tensor Sum(Tensor x, params int[] dim)
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
System.Int32[] |
dim |
The dimensions list.
|
Returns
|
Improve this Doc
View Source
Tan(Tensor)
Calculate the tan value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Tanh(Tensor)
Calculate the hyperbolic tan value element-wise.
Declaration
Parameters
Type |
Name |
Description |
Tensor |
x |
The tensor.
|
Returns
|
Improve this Doc
View Source
Tile(Tensor, Int32, Int32)
Construct an array by repeating A the number of times given by reps.
Declaration
Tensor Tile(Tensor x, int n, int axis = 0)
Parameters
Type |
Name |
Description |
Tensor |
x |
Tensor to be repeated.
|
System.Int32 |
n |
Number of time.
|
System.Int32 |
axis |
The axis to be repeated.
|
Returns
|
Improve this Doc
View Source
Transpose(Tensor)
Declaration
Tensor Transpose(Tensor x)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
Returns
|
Improve this Doc
View Source
Transpose(Tensor, Int32[])
Declaration
Tensor Transpose(Tensor x, params int[] dims)
Parameters
Type |
Name |
Description |
Tensor |
x |
|
System.Int32[] |
dims |
|
Returns
|
Improve this Doc
View Source
UUID(String)
Generate the unique identifier for layers and parameters
Declaration
Parameters
Type |
Name |
Description |
System.String |
name |
The name.
|
Returns
Type |
Description |
System.String |
|