class_docstr: ConfusionMatrixAtK aggregate.
  
  Attributes:
    pos_label: the value considered as positive, default to 1.
    input_type: input encoding type, must be either  `multiclass` or
      `multiclass-multioutput`.
    average: average type, must be one of the types under `AverageType`.
    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.
    k_list: a list of topk each of which slices y_pred by y_pred[:topk] assuming
      the predictions are sorted in descending order.
class_docstr_tok: ["ConfusionMatrixAtK","aggregate",".","Attributes",":","pos_label",":","the","value","considered","as","positive",",","default","to","1.","input_type",":","input","encoding","type",",","must","be","either","`","multiclass","`","or","`","multiclass-multioutput","`",".","average",":","average","type",",","must","be","one","of","the","types","under","`","AverageType","`",".","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",".","k_list",":","a","list","of","topk","each","of","which","slices","y_pred","by","y_pred","[",":","topk","]","assuming","the","predictions","are","sorted","in","descending","order","."]
code: def __post_init__(self):
      if self.input_type not in (
          InputType.MULTICLASS,
          InputType.MULTICLASS_MULTIOUTPUT,
      ):
          raise ValueError(
              f'"{self.input_type}" input is not supported for TopK Confusion'
              " Matrix."
          )
  
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 TopKConfusionMatrixAggFn obj's underlying member method code with example usage: obj.__post_init__() without return types