Method Reduce
Reduce(int, bool)
Removes a dimension at axis
. For example, if this
is (2, 3, 4, 5), the value of axis
is 1, and the value of keepDim
is true
, the method returns (2, 1, 4, 5).
Declaration
public TensorShape Reduce(int axis, bool keepDim = true)
Parameters
Type | Name | Description |
---|---|---|
int | axis | The axis along which to reduce. |
bool | keepDim | When the value is |
Returns
Type | Description |
---|---|
TensorShape | The reduced tensor shape. |
Reduce(ReadOnlySpan<int>, bool)
Creates a TensorShape
by removing the dimensions at axes
. For example, if this
is (2, 3, 4, 5), axis
is {1, 2} and the value of keepDim
is true
, the method returns (2, 1, 1, 5).
Declaration
public TensorShape Reduce(ReadOnlySpan<int> axes, bool keepDim = true)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<int> | axes | The axes along which to reduce. |
bool | keepDim | When the value is |
Returns
Type | Description |
---|---|
TensorShape | The reduced tensor shape. |