Tensor.Add Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>) |
Performs element-wise addition between two tensors. |
| Add<T>(ReadOnlyTensorSpan<T>, T) |
Performs element-wise addition between a tensor and scalar. |
| Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>, TensorSpan<T>) |
Performs element-wise addition between two tensors. |
| Add<T>(ReadOnlyTensorSpan<T>, T, TensorSpan<T>) |
Performs element-wise addition between a tensor and scalar. |
Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>)
- Source:
- Tensor.op_Addition.cs
- Source:
- TensorExtensions.cs
Performs element-wise addition between two tensors.
public:
generic <typename T>
where T : System::Numerics::IAdditionOperators<T, T, T>, System::Numerics::IAdditiveIdentity<T, T> static System::Numerics::Tensors::Tensor<T> ^ Add(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % x, System::Numerics::Tensors::ReadOnlyTensorSpan<T> % y);
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>;
static member Add : ReadOnlyTensorSpan * ReadOnlyTensorSpan -> System.Numerics.Tensors.Tensor<'T (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)> (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)
Public Function Add(Of T As {IAdditionOperators(Of T, T, T), IAdditiveIdentity(Of T, T)}) (ByRef x As ReadOnlyTensorSpan(Of T), ByRef y As ReadOnlyTensorSpan(Of T)) As Tensor(Of T)
Type Parameters
- T
The type of the elements in the tensor.
Parameters
The tensor to add with y.
The tensor to add with x.
Returns
A new tensor containing the result of x + y.
Exceptions
The shapes of x and y are not compatible.
Applies to
Add<T>(ReadOnlyTensorSpan<T>, T)
- Source:
- Tensor.op_Addition.cs
- Source:
- TensorExtensions.cs
Performs element-wise addition between a tensor and scalar.
public:
generic <typename T>
where T : System::Numerics::IAdditionOperators<T, T, T>, System::Numerics::IAdditiveIdentity<T, T> static System::Numerics::Tensors::Tensor<T> ^ Add(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % x, T y);
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>;
static member Add : ReadOnlyTensorSpan * 'T -> System.Numerics.Tensors.Tensor<'T (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)> (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)
Public Function Add(Of T As {IAdditionOperators(Of T, T, T), IAdditiveIdentity(Of T, T)}) (ByRef x As ReadOnlyTensorSpan(Of T), y As T) As Tensor(Of T)
Type Parameters
- T
The type of the elements in the tensor.
Parameters
The tensor to add with y.
- y
- T
The scalar to add with x.
Returns
A new tensor containing the result of x + y.
Applies to
Add<T>(ReadOnlyTensorSpan<T>, ReadOnlyTensorSpan<T>, TensorSpan<T>)
- Source:
- Tensor.op_Addition.cs
- Source:
- TensorExtensions.cs
Performs element-wise addition between two tensors.
public:
generic <typename T>
where T : System::Numerics::IAdditionOperators<T, T, T>, System::Numerics::IAdditiveIdentity<T, T> static System::Numerics::Tensors::TensorSpan<T> ^ Add(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % x, System::Numerics::Tensors::ReadOnlyTensorSpan<T> % y, System::Numerics::Tensors::TensorSpan<T> % destination);
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>;
static member Add : ReadOnlyTensorSpan * ReadOnlyTensorSpan * TensorSpan -> TensorSpan (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)
Public Function Add(Of T As {IAdditionOperators(Of T, T, T), IAdditiveIdentity(Of T, T)}) (ByRef x As ReadOnlyTensorSpan(Of T), ByRef y As ReadOnlyTensorSpan(Of T), ByRef destination As TensorSpan(Of T)) As TensorSpan(Of T)
Type Parameters
- T
The type of the elements in the tensor.
Parameters
The tensor to add with y.
The tensor to add with x.
- destination
- TensorSpan<T>
The destination where the result of x + y is written.
Returns
A reference to destination.
Exceptions
The shapes of x, y, and destination are not compatible.
Applies to
Add<T>(ReadOnlyTensorSpan<T>, T, TensorSpan<T>)
- Source:
- Tensor.op_Addition.cs
- Source:
- TensorExtensions.cs
Performs element-wise addition between a tensor and scalar.
public:
generic <typename T>
where T : System::Numerics::IAdditionOperators<T, T, T>, System::Numerics::IAdditiveIdentity<T, T> static System::Numerics::Tensors::TensorSpan<T> ^ Add(System::Numerics::Tensors::ReadOnlyTensorSpan<T> % x, T y, System::Numerics::Tensors::TensorSpan<T> % destination);
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>;
static member Add : ReadOnlyTensorSpan * 'T * TensorSpan -> TensorSpan (requires 'T :> System.Numerics.IAdditionOperators<'T, 'T, 'T> and 'T :> System.Numerics.IAdditiveIdentity<'T, 'T>)
Public Function Add(Of T As {IAdditionOperators(Of T, T, T), IAdditiveIdentity(Of T, T)}) (ByRef x As ReadOnlyTensorSpan(Of T), y As T, ByRef destination As TensorSpan(Of T)) As TensorSpan(Of T)
Type Parameters
- T
The type of the elements in the tensor.
Parameters
The tensor to add with y.
- y
- T
The scalar to add with x.
- destination
- TensorSpan<T>
The destination where the result of x + y is written.
Returns
A reference to destination.
Exceptions
The shapes of x and destination are not compatible.