TensorShape.WithDimension Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3

Overload List

WithDimension(Axes, Int32) Replaces the specified dimensions with the specified size.
WithDimension(Index, Int32) Returns a tensor shape that has one dimension changed from this shape.
WithDimension(Int32, Int32) Returns a tensor shape that has one dimension changed from this shape.

WithDimension(Axes, Int32)

Replaces the specified dimensions with the specified size.
C#
public TensorShape WithDimension(
	Axes axes,
	int size
)

Parameters

axes  Axes
size  Int32

Return Value

TensorShape
A new tensor shape with the dimensions specified by axes replaced with size.

WithDimension(Index, Int32)

Returns a tensor shape that has one dimension changed from this shape.
C#
public TensorShape WithDimension(
	Index axis,
	int length
)

Parameters

axis  Index
The axis whose dimension is different.
length  Int32
The new dimension along the axis.

Return Value

TensorShape
A tensor shape with the same dimensions as this shape, except along the axis with index axis which has size length.

Exceptions

ArgumentOutOfRangeException

axis is less than zero or greather than or equal to the rank of the tensor shape.

WithDimension(Int32, Int32)

Returns a tensor shape that has one dimension changed from this shape.
C#
public TensorShape WithDimension(
	int axis,
	int length
)

Parameters

axis  Int32
The axis whose dimension is different.
length  Int32
The new dimension along the axis.

Return Value

TensorShape
A tensor shape with the same dimensions as this shape, except along the axis with index axis which has size length.

Exceptions

ArgumentOutOfRangeException

axis is less than zero or greather than or equal to the rank of the tensor shape.

See Also