Method countTrue
static member countTrue: Tensor<bool> -> int64
Counts the elements being true.
Declaration
static member countTrue: src:Tensor<bool> -> int64
Parameters
Type | Name | Description |
---|---|---|
Tensor<bool> | src | The tensor containing the source values. |
Returns
Type | Description |
---|---|
int64 | A scalar containing the result of this operation. |
Remarks
The number of elements that are true is counted and returned as a scalar.
Examples
let a = HostTensor.ofList2D [[true; false; true; false]
[false; true; true; false]]
let b = Tensor.countTrue a // b = 4L