class_docstr: Generate random posterize parameters for a batch of images.
  
  Args:
      bits: floats that ranged from (0, 8], in which 0 gives black image and 8 gives the original.
          If float x, bits will be generated from (x, 8).
          If tuple (x, y), bits will be generated from (x, y).
  
  Returns:
      A dict of parameters to be passed for transformation.
          - bits_factor (Tensor): element-wise bit factors with a shape of (B,).
  
  Note:
      The generated random numbers are not reproducible across different devices and dtypes. By default,
      the parameters will be generated on CPU in float32. This can be changed by calling
      ``self.set_rng_device_and_dtype(device="cuda", dtype=torch.float64)``.
class_docstr_tok: ["Generate","random","posterize","parameters","for","a","batch","of","images",".","Args",":","bits",":","floats","that","ranged","from","(","0",",","8","]",",","in","which","0","gives","black","image","and","8","gives","the","original",".","If","float","x",",","bits","will","be","generated","from","(","x",",","8",")",".","If","tuple","(","x",",","y",")",",","bits","will","be","generated","from","(","x",",","y",")",".","Returns",":","A","dict","of","parameters","to","be","passed","for","transformation",".","-","bits_factor","(","Tensor",")",":","element-wise","bit","factors","with","a","shape","of","(","B",",",")",".","Note",":","The","generated","random","numbers","are","not","reproducible","across","different","devices","and","dtypes",".","By","default",",","the","parameters","will","be","generated","on","CPU","in","float32",".","This","can","be","changed","by","calling","``","self.set_rng_device_and_dtype","(","device=","''","cuda","''",",","dtype=torch.float64",")","``","."]
code: def __init__(
      self, bits: Union[float, Tuple[float, float], Tensor]
  ) -> None:
      super().__init__()
      self.bits_factor = bits
  
file_path: kornia/kornia/augmentation/random_generator/_2d/posterize.py
imports: from typing import Dict, Tuple, Union
  import torch
  from kornia.augmentation.random_generator.base import RandomGeneratorBase, UniformDistribution
  from kornia.augmentation.utils import _adapted_rsampling, _common_param_check, _joint_range_check
  from kornia.core import Tensor, as_tensor
  from kornia.utils.helpers import _extract_device_dtype
label_desc: Use image node_id 1 to create a new PosterizeGenerator object from inherited base classes: RandomGeneratorBase with example: obj = PosterizeGenerator(bits)