Class Conv
Represents a Conv
convolution layer, which applies a convolution filter to an input tensor.
Inherited Members
Namespace: Unity.Sentis.Layers
Syntax
[Serializable]
public class Conv : FusedActivation
Constructors
Conv(String, String, String, String, Int32, Int32[], Int32[], Int32[], AutoPad, Int32[], FusableActivation)
Initializes and returns an instance of Conv
convolution layer.
Declaration
public Conv(string name, string X, string W, string B, int group, int[] strides, int[] pads, int[] dilations, AutoPad autoPad = AutoPad.NotSet, int[] kernelShape = null, FusableActivation fusedActivation = FusableActivation.None)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name to use for the output tensor of the layer. |
String | X | The name to use for the input tensor of the layer. |
String | W | The name to use for the filter tensor of the layer. |
String | B | The name to use for the optional bias tensor of the layer. |
Int32 | group | The number of groups that input channels and output channels are divided into. |
Int32[] | strides | The optional stride value for each spatial dimension of the filter. |
Int32[] | pads | The optional lower and upper padding values for each spatial dimension of the filter. |
Int32[] | dilations | The optional dilation value of each spatial dimension of the filter. |
AutoPad | autoPad | The auto padding mode of the convolution as an |
Int32[] | kernelShape | |
FusableActivation | fusedActivation | The fused activation type to apply after the convolution. The default value is |
Fields
autoPad
The auto padding mode of the convolution as an AutoPad
.
Declaration
public AutoPad autoPad
Field Value
Type | Description |
---|---|
AutoPad |
dilations
The dilation value of each spatial dimension of the filter.
If this is null
the layer uses a default of [1, 1, ..., 1].
Declaration
public int[] dilations
Field Value
Type | Description |
---|---|
Int32[] |
group
The number of groups that input channels and output channels are divided into.
Declaration
public int group
Field Value
Type | Description |
---|---|
Int32 |
kernelShape
Declaration
public int[] kernelShape
Field Value
Type | Description |
---|---|
Int32[] |
pads
The lower and upper padding values for each spatial dimension of the filter, [pad_left, pad_right] for 1D, [pad_top, pad_bottom, pad_left, pad_right] for 2D, etc.
If this is null
the layer uses a default of [0, 0, ..., 0].
Declaration
public int[] pads
Field Value
Type | Description |
---|---|
Int32[] |
strides
The stride value for each spatial dimension of the filter.
If this is null
the layer uses a default of [1, 1, ..., 1].
Declaration
public int[] strides
Field Value
Type | Description |
---|---|
Int32[] |
Methods
Execute(Tensor[], ExecutionContext)
Executes the layer using the operations and variables from the ExecutionContext
and returns the output tensor.
If the layer has more than one output, output tensors are saved to variables.
Declaration
public override Tensor Execute(Tensor[] inputTensors, ExecutionContext ctx)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | inputTensors | |
ExecutionContext | ctx |
Returns
Type | Description |
---|---|
Tensor |
Overrides
ToString()
Returns a string that represents the Layer
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |