class_docstr: Lazy multihead mask, combines multiple lazy masks one per head.
class_docstr_tok: ["Lazy","multihead","mask",",","combines","multiple","lazy","masks","one","per","head","."]
code: def __getitem__(self, idx) -> np.ndarray:
      if len(idx) != 3:
          raise NotImplementedError(f"Unsupported slice: {idx}")
  
      head_slice = idx[0]
      if isinstance(head_slice, int):
          assert head_slice >= 0 and head_slice <= len(self.masks)
          return self.masks[head_slice][idx[1:]]
      else:
          slice_masks = [
              mask[idx[1:]] for mask in self.masks[head_slice]
          ]
          return np.stack(slice_masks)
  
imports: from __future__ import annotations
  import dataclasses
  from typing import Any, Callable, Sequence, Tuple
  import numpy
label_desc: Use image node_id 3 for calling the MultiHeadMask obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self, np