IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

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, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

Methods​

__init__​

def __init__(value: Scalar[T], count: Int32) -> Self

def __init__() -> Self

__add__​

def __add__(self, other: Self) -> Self

__iadd__​

def __iadd__(mut self, other: Self)