Tensor.Add Method

Definition

Overloads

Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>)

Adds each element of x to each element of y and returns a new Tensor<T> with the result.

Add<T>(ReadOnlyTensorSpan<T>, T)

Adds y to each element of x and returns a new Tensor<T> with the result.

Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>, TensorSpan<T>)

Adds each element of x to each element of y and returns a new ReadOnlyTensorSpan<T> with the result.

Add<T>(ReadOnlyTensorSpan<T>, T, TensorSpan<T>)

Adds y to each element of x and returns a new TensorSpan<T> with the result.

Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>)

Source:
TensorExtensions.cs

Adds each element of x to each element of y and returns a new Tensor<T> with the result.

public static System.Numerics.Tensors.Tensor<T> Add<T> (in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x, in System.Numerics.Tensors.ReadOnlyTensorSpan<T> y) where T : System.Numerics.IAdditionOperators<T,T,T>, System.Numerics.IAdditiveIdentity<T,T>;

Type Parameters

T

Parameters

y
ReadOnlyTensorSpan<T>

The second ReadOnlyTensorSpan<T> of values to add.

Returns

Applies to

.NET 9 (package-provided) og .NET 8 (package-provided)
Produkt Versjoner
.NET 8 (package-provided), 9 (package-provided)

Add<T>(ReadOnlyTensorSpan<T>, T)

Source:
TensorExtensions.cs

Adds y to each element of x and returns a new Tensor<T> with the result.

public static System.Numerics.Tensors.Tensor<T> Add<T> (in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x, T y) where T : System.Numerics.IAdditionOperators<T,T,T>, System.Numerics.IAdditiveIdentity<T,T>;

Type Parameters

T

Parameters

y
T

The T to add to each element of x.

Returns

Applies to

.NET 9 (package-provided) og .NET 8 (package-provided)
Produkt Versjoner
.NET 8 (package-provided), 9 (package-provided)

Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>, TensorSpan<T>)

Source:
TensorExtensions.cs

Adds each element of x to each element of y and returns a new ReadOnlyTensorSpan<T> with the result.

public static ref readonly System.Numerics.Tensors.TensorSpan<T> Add<T> (scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x, scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> y, in System.Numerics.Tensors.TensorSpan<T> destination) where T : System.Numerics.IAdditionOperators<T,T,T>, System.Numerics.IAdditiveIdentity<T,T>;

Type Parameters

T

Parameters

y
ReadOnlyTensorSpan<T>

The second ReadOnlyTensorSpan<T> of values to add.

destination
TensorSpan<T>

Returns

Applies to

.NET 9 (package-provided) og .NET 8 (package-provided)
Produkt Versjoner
.NET 8 (package-provided), 9 (package-provided)

Add<T>(ReadOnlyTensorSpan<T>, T, TensorSpan<T>)

Source:
TensorExtensions.cs

Adds y to each element of x and returns a new TensorSpan<T> with the result.

public static ref readonly System.Numerics.Tensors.TensorSpan<T> Add<T> (scoped in System.Numerics.Tensors.ReadOnlyTensorSpan<T> x, T y, in System.Numerics.Tensors.TensorSpan<T> destination) where T : System.Numerics.IAdditionOperators<T,T,T>, System.Numerics.IAdditiveIdentity<T,T>;

Type Parameters

T

Parameters

y
T

The T to add to each element of x.

destination
TensorSpan<T>

Returns

Applies to

.NET 9 (package-provided) og .NET 8 (package-provided)
Produkt Versjoner
.NET 8 (package-provided), 9 (package-provided)