TensorBackEnd.Copy<T> Method

Copies the elements of one tensor to another, or to a new tensor.

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0
C#
public abstract Tensor<T> Copy<T>(
	Tensor<T> source,
	Tensor<bool>? mask = null,
	bool initializeToZero = true,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

source  Tensor<T>
A tensor.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements should be included in the operation. If null (the default), the operation is applied everywhere.
initializeToZero  Boolean  (Optional)
Specifies if the elements of the result tensor for which mask is false should be set to zero. The default is true.
order  TensorElementOrder  (Optional)
Optional. The desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A tensor of the same shape as source whose elements where mask is true are equal to the corresponding elements of source.

Exceptions

ArgumentNullException

source is null.

See Also