Class Clip
Represents an element-wise Clip math layer: f(x, xmin, xmax) = min(max(x, xmin), xmax)
Inherited Members
Namespace: Unity.Sentis.Layers
Syntax
[Serializable]
public class Clip : Layer
Constructors
Clip(String, String)
Initializes and returns an instance of Clip math layer with no min or max tensors.
Declaration
public Clip(string name, string input)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name to use for the output tensor of the layer. |
| String | input | The name to use for the input tensor of the layer. |
Clip(String, String, String)
Initializes and returns an instance of Clip math layer with no max tensor.
Declaration
public Clip(string name, string input, string min)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name to use for the output tensor of the layer. |
| String | input | The name to use for the input tensor of the layer. |
| String | min | The name to use for the min scalar tensor of the layer. |
Clip(String, String, String, String)
Initializes and returns an instance of Clip math layer.
Declaration
public Clip(string name, string input, string min, string max)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name to use for the output tensor of the layer. |
| String | input | The name to use for the input tensor of the layer. |
| String | min | The name to use for the min scalar tensor of the layer. |
| String | max | The name to use for the max scalar tensor of the layer. |
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[] inputs, ExecutionContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | inputs | |
| ExecutionContext | ctx |
Returns
| Type | Description |
|---|---|
| Tensor |