class_docstr: ConfusionMatrix aggregate.
  
  Attributes:
    pos_label: the value considered as positive, default to 1.
    input_type: input encoding type, must be one of `InputType`.
    average: fixed as `samples` average.
    vocab: an external vocabulary that maps categorical value to integer class
      id. This is required if computed distributed (when merge_accumulators is
      called) and the average is macro where the class id mapping needs to be
      stable.
    dtype: dtype of the confusion matrix and all computations. Default to None
      as it is inferred.
class_docstr_tok: ["ConfusionMatrix","aggregate",".","Attributes",":","pos_label",":","the","value","considered","as","positive",",","default","to","1.","input_type",":","input","encoding","type",",","must","be","one","of","`","InputType","`",".","average",":","fixed","as","`","samples","`","average",".","vocab",":","an","external","vocabulary","that","maps","categorical","value","to","integer","class","id",".","This","is","required","if","computed","distributed","(","when","merge_accumulators","is","called",")","and","the","average","is","macro","where","the","class","id","mapping","needs","to","be","stable",".","dtype",":","dtype","of","the","confusion","matrix","and","all","computations",".","Default","to","None","as","it","is","inferred","."]
code: def __post_init__(self):
      if self.input_type == InputType.BINARY:
          raise ValueError(
              "Samples average is not available for Binary classification."
          )
  
imports: from collections.abc import Iterable, Sequence
  import dataclasses
  import enum
  import itertools
  from typing import Any
  import numpy
  from numpy import typing
  from tensorflow_model_analysis.experimental.lazytf import api
label_desc: Use image node_id 1 for calling the SamplewiseConfusionMatrixAggFn obj's underlying member method code with example usage: obj.__post_init__() without return types