class_docstr: Base class for hyperprior autoencoder.
  
  This base class wraps a number of utility functions for working with
  Balle-style compression autoencoders implemented in the style of
  CompressAI, such as parameter collection and device management. Users are
  expected to subclass this calss before writing the appropriate PyTorch
  operations.
class_docstr_tok: ["Base","class","for","hyperprior","autoencoder",".","This","base","class","wraps","a","number","of","utility","functions","for","working","with","Balle-style","compression","autoencoders","implemented","in","the","style","of","CompressAI",",","such","as","parameter","collection","and","device","management",".","Users","are","expected","to","subclass","this","calss","before","writing","the","appropriate","PyTorch","operations","."]
docstr: Separates the trainable parameters of the model into groups.
  
  The module's parameters are organized into "model parameters" (the
  parameters that dictate the function of the model) and "quantile
  parameters" (which are only used to learn the quantiles of the
  hyper_bottleneck layer's factorized distribution, for use at inference
  time).
  
  Returns:
      tuple of (model parameter_dict, quantile parameter_dict)
docstr_tok: ["Separates","the","trainable","parameters","of","the","model","into","groups",".","The","module","'s","parameters","are","organized","into","``","model","parameters","''","(","the","parameters","that","dictate","the","function","of","the","model",")","and","``","quantile","parameters","''","(","which","are","only","used","to","learn","the","quantiles","of","the","hyper_bottleneck","layer","'s","factorized","distribution",",","for","use","at","inference","time",")",".","Returns",":","tuple","of","(","model","parameter_dict",",","quantile","parameter_dict",")"]
code: def collect_parameters(
      self,
  ) -> Tuple[List[nn.Parameter], List[nn.Parameter]]:
      """
      Separates the trainable parameters of the model into groups.
  
      The module's parameters are organized into "model parameters" (the
      parameters that dictate the function of the model) and "quantile
      parameters" (which are only used to learn the quantiles of the
      hyper_bottleneck layer's factorized distribution, for use at inference
      time).
  
      Returns:
          tuple of (model parameter_dict, quantile parameter_dict)
      """
      model_parameters = {
          n: p
          for n, p in self.named_parameters()
          if not n.endswith(".quantiles") and p.requires_grad
      }
      quantile_parameters = {
          n: p
          for n, p in self.named_parameters()
          if n.endswith(".quantiles") and p.requires_grad
      }
  
      model_keys = set(model_parameters.keys())
      quantile_keys = set(quantile_parameters.keys())
  
      # Make sure we don't have an intersection of parameters
      params_dict = {
          k: p
          for k, p in self.named_parameters()
          if p.requires_grad is True
      }
      params_keys = set(params_dict.keys())
  
      inter_keys = model_keys.intersection(quantile_keys)
      union_keys = model_keys.union(quantile_keys)
  
      if len(inter_keys) != 0 or union_keys != params_keys:
          raise RuntimeError(
              "Separating model and quantile parameters failed."
          )
  
      return [v for _, v in model_parameters.items()], [
          v for _, v in quantile_parameters.items()
      ]
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  from compressai.entropy_models import EntropyBottleneck
  from compressai.models import CompressionModel
  from compressai.ops import quantize_ste
  from torch import Tensor
  from neuralcompression import HyperpriorCompressedOutput, HyperpriorOutput
label_desc: Use image node_id 4 for calling the _HyperpriorAutoencoderBase obj's underlying member method code with example usage: obj.collect_parameters() and returns: unknown,  unknown