Class Shape
Represents a Shape
layer. This computes the shape of an input tensor as a 1D TensorInt
.
Inherited Members
Namespace: Unity.Sentis.Layers
Syntax
[Serializable]
public class Shape : Layer
Constructors
Shape(String, String, Int32, Int32)
Initializes and returns an instance of Shape
layer.
Declaration
public Shape(string name, string input, int start = 0, int end = 8)
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. The layer does not use the values of this tensor in the computation. |
Int32 | start | The inclusive start axis for slicing the shape of the input tensor. The default value is 0. |
Int32 | end | The exclusive end axis for slicing the shape of the input tensor. The default value is 8. |
Fields
end
The exclusive end axis for slicing the shape of the input tensor.
If this is negative then the dimensions of the tensor are counted from the back.
Declaration
public int end
Field Value
Type | Description |
---|---|
Int32 |
start
The inclusive start axis for slicing the shape of the input tensor.
If this is negative then the axes of the tensor are counted from the back.
Declaration
public int start
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 |