Method Squeeze
Squeeze()
Creates a TensorShape
by duplicating this
and removing the dimensions of size 1. For example, if this
is (5, 1, 3, 1), the method returns (5, 3).
Declaration
public TensorShape Squeeze()
Returns
Type | Description |
---|---|
TensorShape | The squeezed tensor shape. |
Squeeze(int)
Creates a TensorShape
by duplicating this
and removing the given axis of size 1. For example, if this
is (5, 1, 3, 1), and axis
is 1, the method returns (5, 3, 1).
Declaration
public TensorShape Squeeze(int axis)
Parameters
Type | Name | Description |
---|---|---|
int | axis | The axis to squeeze. |
Returns
Type | Description |
---|---|
TensorShape | The squeezed tensor shape. |
Squeeze(ReadOnlySpan<int>)
Creates a TensorShape
by duplicating this
and removing the given axes of size 1. For example, if this
is (5, 1, 3, 1), and axes
is {1, -1}, the method returns (5, 3).
Declaration
public TensorShape Squeeze(ReadOnlySpan<int> axes)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<int> | axes | The axes to squeeze. |
Returns
Type | Description |
---|---|
TensorShape | The squeezed tensor shape. |