Прочетете на английски

Споделяне чрез


Tensor.SqueezeDimension Method

Definition

Overloads

SqueezeDimension<T>(Tensor<T>, Int32)

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

SqueezeDimension<T>(ReadOnlyTensorSpan<T>, Int32)

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

SqueezeDimension<T>(TensorSpan<T>, Int32)

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

SqueezeDimension<T>(Tensor<T>, Int32)

Source:
TensorExtensions.cs
Source:
TensorExtensions.cs

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

C#
public static System.Numerics.Tensors.Tensor<T> SqueezeDimension<T>(this System.Numerics.Tensors.Tensor<T> tensor, int dimension);

Type Parameters

T

Parameters

tensor
Tensor<T>

The Tensor<T> to remove dimension of length 1.

dimension
Int32

The dimension to remove.

Returns

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)

SqueezeDimension<T>(ReadOnlyTensorSpan<T>, Int32)

Source:
TensorExtensions.cs
Source:
TensorExtensions.cs

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

C#
public static System.Numerics.Tensors.ReadOnlyTensorSpan<T> SqueezeDimension<T>(this in System.Numerics.Tensors.ReadOnlyTensorSpan<T> tensor, int dimension);

Type Parameters

T

Parameters

tensor
ReadOnlyTensorSpan<T>

The ReadOnlyTensorSpan<T> to remove dimension of length 1.

dimension
Int32

The dimension to remove.

Returns

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)

SqueezeDimension<T>(TensorSpan<T>, Int32)

Source:
TensorExtensions.cs
Source:
TensorExtensions.cs

Removes axis of length one from the tensor for the given dimension. If the dimension is not of length one it will throw an exception.

C#
public static System.Numerics.Tensors.TensorSpan<T> SqueezeDimension<T>(this in System.Numerics.Tensors.TensorSpan<T> tensor, int dimension);

Type Parameters

T

Parameters

tensor
TensorSpan<T>

The TensorSpan<T> to remove dimension of length 1.

dimension
Int32

The dimension to remove.

Returns

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)