Mojo struct
ValueCount
struct ValueCount[T: DType]
A struct that holds a value and a count, used for block reductions.
This is useful for computing both the sum of values and the count of elements that satisfy a condition in a single reduction pass.
Parametersβ
- βT (
DType): The DType of the value field.
Fieldsβ
- βvalue (
Scalar[T]): - βcount (
Int32):
Implemented traitsβ
AnyType,
Copyable,
Defaultable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable
Methodsβ
__init__β
__init__(value: Scalar[T], count: Int32) -> Self
__init__() -> Self
__add__β
__add__(self, other: Self) -> Self
__iadd__β
__iadd__(mut self, other: Self)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!