TensorBackEnd.Any Method

Definition

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

Overload List

Any(Tensor<Boolean>, Tensor<Boolean>) Returns whether any elements of a boolean tensor are true.
Any(Tensor<Boolean>, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, TensorElementOrder) Computes whether any elements of a boolean tensor along the specified axis are true.
Any<T, TPredicate>(TPredicate, Tensor<T>, Tensor<Boolean>, Boolean) Returns whether any elements of a tensor satisfy a predicate.
Any<T, TPredicate>(TPredicate, Tensor<T>, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, Boolean, TensorElementOrder) Computes whether any elements of a tensor along the specified axis satisfy a predicate.
Any<T1, T2, TPredicate>(TPredicate, Tensor<T1>, Tensor<T2>, Tensor<Boolean>) Returns whether any elements of a pair of tensors satisfy a predicate.

Any(Tensor<Boolean>, Tensor<Boolean>)

Returns whether any elements of a boolean tensor are true.
C#
public virtual bool Any(
	Tensor<bool> operand,
	Tensor<bool>? mask = null
)

Parameters

operand  Tensor<Boolean>
The tensor that contains the elements to check.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies which elements should be included in the operation. If null (the default), all elements are included.

Return Value

Boolean
true if any elements that satisfy mask are true; otherwise false.

Any<T, TPredicate>(TPredicate, Tensor<T>, Tensor<Boolean>, Boolean)

Returns whether any elements of a tensor satisfy a predicate.
C#
public abstract bool Any<T, TPredicate>(
	TPredicate predicate,
	Tensor<T> operand,
	Tensor<bool>? mask = null,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

predicate  TPredicate
The predicate that the elements must satisfy.
operand  Tensor<T>
The tensor that contains the elements to check.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies which elements should be included in the operation. If null (the default), any elements are included.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the evaluation. The default is false.

Type Parameters

T
TPredicate

Return Value

Boolean
true if any elements that satisfy mask also satisfy predicate; otherwise false.

Any<T1, T2, TPredicate>(TPredicate, Tensor<T1>, Tensor<T2>, Tensor<Boolean>)

Returns whether any elements of a pair of tensors satisfy a predicate.
C#
public abstract bool Any<T1, T2, TPredicate>(
	TPredicate predicate,
	Tensor<T1> tensor1,
	Tensor<T2> tensor2,
	Tensor<bool>? mask = null
)
where TPredicate : struct, new(), IFastFunc<T1, T2, bool>

Parameters

predicate  TPredicate
The predicate that the elements must satisfy.
tensor1  Tensor<T1>
The tensor that contains the elements to check.
tensor2  Tensor<T2>
The tensor that contains the elements to check.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies which elements should be included in the operation. If null (the default), all elements are included.

Type Parameters

T1
T2
TPredicate

Return Value

Boolean
true if any elements that satisfy mask also satisfy predicate; otherwise false.

Any(Tensor<Boolean>, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, TensorElementOrder)

Computes whether any elements of a boolean tensor along the specified axis are true.
C#
public virtual Tensor<bool> Any(
	Tensor<bool> operand,
	Axes axis,
	Tensor<bool>? result = null,
	bool keepDimensions = false,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

operand  Tensor<Boolean>
A boolean tensor.
axis  Axes
The axis along which to sum the elements. The default is 0.
result  Tensor<Boolean>  (Optional)
Optional. The tensor that is to hold the result. May be null.
keepDimensions  Boolean  (Optional)
Optional. Specifies whether the reduced axis should be retained in the result. The default is false.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. Specifies the element order of the result. By default, elements are stored in the order of operand.

Return Value

Tensor<Boolean>
A tensor containing a value that indicates whether any elements of operand that satisfy mask along axis are true.

Any<T, TPredicate>(TPredicate, Tensor<T>, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, Boolean, TensorElementOrder)

Computes whether any elements of a tensor along the specified axis satisfy a predicate.
C#
public virtual Tensor<bool> Any<T, TPredicate>(
	TPredicate predicate,
	Tensor<T> operand,
	Axes axis,
	Tensor<bool>? result = null,
	bool keepDimensions = false,
	Tensor<bool>? mask = null,
	bool skipMissingValues = false,
	TensorElementOrder order = TensorElementOrder.Automatic
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

predicate  TPredicate
The predicate that the elements must satisfy.
operand  Tensor<T>
A boolean tensor.
axis  Axes
The axis along which to sum the elements. The default is 0.
result  Tensor<Boolean>  (Optional)
Optional. The tensor that is to hold the result. May be null.
keepDimensions  Boolean  (Optional)
Optional. Specifies whether the reduced axis should be retained in the result. The default is false.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies which elements should be included in the operation. If null (the default), all elements are included.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the evaluation. The default is false.
order  TensorElementOrder  (Optional)
Optional. Specifies the element order of the result. By default, elements are stored in the order of operand.

Type Parameters

T
TPredicate

Return Value

Tensor<Boolean>
A tensor containing a value that indicates whether any elements of operand that satisfy mask along axis also satisfy predicate.

See Also